gcc/testsuite/g++.dg/cpp2a/concepts-fn4.C
raw| 1 | // Testcase from [expr.prim.id]/5 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | template<typename T> struct A { |
| 5 | static void f(int) requires false; |
| 6 | }; |
| 7 | void g() { |
| 8 | A<int>::f(0); // { dg-error "" "cannot call f" } |
| 9 | void (*p1)(int) = A<int>::f; // { dg-error "" "cannot take the address of f" } |
| 10 | decltype(A<int>::f)* p2 = nullptr; // { dg-error "" "the type decltype(A<int>::f) is invalid" } |
| 11 | } |