* doc/invoke.texi: Document -std=c++17 and -std=gnu++17 and document
[official-gcc.git] / gcc / testsuite / g++.dg / concepts / fn8.C
blob5c796c7e3b2ad4356a1bde8009d8707a4006ccb6
1 // { dg-options "-std=c++17 -fconcepts" }
3 template<typename T>
4   concept bool Class() { return __is_class(T); }
6 template<Class T> void f(T) { }
8 template<typename T> void fn(T) { }
10 auto p1 = &f<int>; // { dg-error "no matches" }
11 void (*p2)(int) = &f<int>; // { dg-error "no matches" }
12 void (*p3)(int) = &f; // { dg-error "no matches" }
14 struct S {
15   template<Class T> int f(T) { }
18 auto p4 = &S::template f<int>; // { dg-error "no matches" }
19 int (S::*p6)(int) = &S::template f<int>; // { dg-error "no matches" }
20 int (S::*p7)(int) = &S::f; // { dg-error "no matches" }
22 template<typename T>
23   void g(T x) { }
25 int main () {
26   g(&f<int>); // { dg-error "no matches" }