]>
Commit | Line | Data |
---|---|---|
be515b4c MP |
1 | // { dg-do compile { target c++17 } } |
2 | // { dg-options "-fconcepts" } | |
971e17ff AS |
3 | |
4 | typedef concept int CINT; // { dg-error "'concept' cannot appear in a typedef declaration" } | |
5 | ||
6 | void f(concept int); // { dg-error "a parameter cannot be declared 'concept'" } | |
7 | ||
8 | template<typename T> | |
9 | concept int f2() { return 0; } // { dg-error "return type" } | |
f2cb6e64 | 10 | concept bool f3(); // { dg-error "14:concept .f3. has no definition" } |
971e17ff AS |
11 | |
12 | struct X | |
13 | { | |
14 | template<typename T> | |
15 | concept int f4() { return 0; } // { dg-error "return type|member function" } | |
16 | concept bool f5() { return true; } // { dg-error "member function" } | |
17 | template<typename T> | |
18 | static concept bool f6() { return true; } // { dg-error "a concept cannot be a member function" } | |
19 | static concept bool x; // { dg-error "declared 'concept'" } | |
0ecf545c | 20 | // { dg-error "uninitialized 'const" "" { target *-*-* } .-1 } |
971e17ff AS |
21 | concept int x2; // { dg-error "declared 'concept'" } |
22 | concept ~X(); // { dg-error "a destructor cannot be 'concept'" } | |
23 | concept X(); // { dg-error "a constructor cannot be 'concept'" } | |
24 | }; | |
25 | ||
26 | concept bool X2; // { dg-error "non-template variable" } | |
27 | ||
28 | template<typename T> | |
29 | concept bool X3; // { dg-error "has no initializer" } | |
30 | ||
31 | struct S { | |
32 | template<typename T> | |
33 | static concept bool C1 = true; // { dg-error "static data member" } | |
34 | }; |