PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / concepts / decl-diagnose.C
blobcaf6b2e5e3fd09519e3153dccbc63cfb54cd51c5
1 // { dg-options "-std=c++17 -fconcepts" }
3 typedef concept int CINT; // { dg-error "'concept' cannot appear in a typedef declaration" }
5 void f(concept int); // { dg-error "a parameter cannot be declared 'concept'" }
7 template<typename T>
8 concept int f2() { return 0; } // { dg-error "return type" }
9 concept bool f3(); // { dg-error "14:concept .f3. has no definition" }
11 struct X
13   template<typename T>
14   concept int f4() { return 0; } // { dg-error "return type|member function" }
15   concept bool f5() { return true; } // { dg-error "member function" }
16   template<typename T>
17   static concept bool f6() { return true; } // { dg-error "a concept cannot be a member function" }
18   static concept bool x; // { dg-error "declared 'concept'" }
19                          // { dg-error "uninitialized const" "" { target *-*-* } .-1 }
20   concept int x2; // { dg-error "declared 'concept'" }
21   concept ~X(); // { dg-error "a destructor cannot be 'concept'" }
22   concept X(); // { dg-error "a constructor cannot be 'concept'" }
25 concept bool X2; // { dg-error "non-template variable" }
27 template<typename T>
28   concept bool X3; // { dg-error "has no initializer" }
30 struct S {
31   template<typename T>
32     static concept bool C1 = true; // { dg-error "static data member" }