145
|
1 // { dg-do compile { target c++17_only } }
|
131
|
2 // { dg-options "-fconcepts" }
|
111
|
3
|
|
4 template<typename T>
|
|
5 concept bool Class() { return __is_class(T); }
|
|
6
|
|
7 template<Class T> void f(T) { }
|
|
8
|
|
9 template<typename T> void fn(T) { }
|
|
10
|
145
|
11 auto p1 = &f<int>; // { dg-error "" }
|
111
|
12 void (*p2)(int) = &f<int>; // { dg-error "no matches" }
|
|
13 void (*p3)(int) = &f; // { dg-error "no matches" }
|
|
14
|
|
15 struct S {
|
131
|
16 template<Class T> int f(T) { return 0; }
|
111
|
17 };
|
|
18
|
145
|
19 auto p4 = &S::template f<int>; // { dg-error "" }
|
111
|
20 int (S::*p6)(int) = &S::template f<int>; // { dg-error "no matches" }
|
|
21 int (S::*p7)(int) = &S::f; // { dg-error "no matches" }
|
|
22
|
|
23 template<typename T>
|
|
24 void g(T x) { }
|
|
25
|
|
26 int main () {
|
|
27 g(&f<int>); // { dg-error "no matches" }
|
|
28 }
|