]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/g++.dg/concepts/decl-diagnose.C
c-decl.c (start_decl): Adjust quoting and hyphenation in diagnostics.
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / concepts / decl-diagnose.C
CommitLineData
be515b4c
MP
1// { dg-do compile { target c++17 } }
2// { dg-options "-fconcepts" }
971e17ff
AS
3
4typedef concept int CINT; // { dg-error "'concept' cannot appear in a typedef declaration" }
5
6void f(concept int); // { dg-error "a parameter cannot be declared 'concept'" }
7
8template<typename T>
9concept int f2() { return 0; } // { dg-error "return type" }
f2cb6e64 10concept bool f3(); // { dg-error "14:concept .f3. has no definition" }
971e17ff
AS
11
12struct 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
26concept bool X2; // { dg-error "non-template variable" }
27
28template<typename T>
29 concept bool X3; // { dg-error "has no initializer" }
30
31struct S {
32 template<typename T>
33 static concept bool C1 = true; // { dg-error "static data member" }
34};