Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/concepts-locations1.C

raw
1 // { dg-do compile { target c++20 } }
2
3 struct S
4 {
5 concept S(); // { dg-error "3:a constructor cannot be .concept." }
6 // { dg-error "concept definition syntax" "" { target *-*-* } .-1 }
7 concept int s = 1; // { dg-error "3:non-static data member .s. declared .concept." }
8 // { dg-error "concept definition syntax" "" { target *-*-* } .-1 }
9 concept void foo(); // { dg-error "3:a concept cannot be a member function" }
10 // { dg-error "concept definition syntax" "" { target *-*-* } .-1 }
11 concept ~S(); // { dg-error "3:a destructor cannot be .concept." }
12 // { dg-error "concept definition syntax" "" { target *-*-* } .-1 }
13 };
14
15 typedef concept int my_int; // { dg-error "9:.concept. cannot appear in a typedef declaration" }
16 // { dg-error "concept definition syntax" "" { target *-*-* } .-1 }
17
18 void bar(concept int); // { dg-error "10:a parameter cannot be declared .concept." }
19 // { dg-error "concept definition syntax" "" { target *-*-* } .-1 }
20
21 concept int i = 0; // { dg-error "1:a non-template variable cannot be .concept." }
22 // { dg-error "concept definition syntax" "" { target *-*-* } .-1 }