clang/test/CXX/over/over.match/over.match.best/over.best.ics/p6.cpp
raw| 1 | // RUN: %clang_cc1 -fsyntax-only -verify=cxx23 -std=c++23 %s |
| 2 | // RUN: %clang_cc1 -fsyntax-only -verify=cxx20 -std=c++20 %s |
| 3 | // cxx23-no-diagnostics |
| 4 | |
| 5 | struct __unique { |
| 6 | static constexpr auto operator()() { return 4; }; // cxx20-warning {{is a C++23 extension}} |
| 7 | |
| 8 | using P = int(); |
| 9 | constexpr operator P*() { return operator(); } |
| 10 | }; |
| 11 | |
| 12 | __unique four{}; |
| 13 | |
| 14 | int test_four() { |
| 15 | // Checks that overload resolution works. |
| 16 | return four(); |
| 17 | } |