c++: change -fconcepts to mean C++20 concepts
[official-gcc.git] / gcc / testsuite / g++.dg / concepts / fn8.C
blob594270f5178d3474af17139509cb88ec20ab2f84
1 // { dg-do compile { target c++17_only } }
2 // { dg-options "-fconcepts-ts" }
4 template<typename T>
5   concept bool Class() { return __is_class(T); }
7 template<Class T> void f(T) { }
9 template<typename T> void fn(T) { }
11 auto p1 = &f<int>; // { dg-error "" }
12 void (*p2)(int) = &f<int>; // { dg-error "no matches" }
13 void (*p3)(int) = &f; // { dg-error "no matches" }
15 struct S {
16   template<Class T> int f(T) { return 0; }
19 auto p4 = &S::template f<int>; // { dg-error "" }
20 int (S::*p6)(int) = &S::template f<int>; // { dg-error "no matches" }
21 int (S::*p7)(int) = &S::f; // { dg-error "no matches" }
23 template<typename T>
24   void g(T x) { }
26 int main () {
27   g(&f<int>); // { dg-error "no match" }