aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/concepts-locations1.C
blob: c841daec7f2848d5fc2bf99dbbed60c2d84d7abd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// { dg-do compile { target c++20 } }

struct S
{
  concept S();  // { dg-error "3:a constructor cannot be .concept." }
  // { dg-error "concept definition syntax" "" { target *-*-* } .-1 }
  concept int s = 1;  // { dg-error "3:non-static data member .s. declared .concept." }
  // { dg-error "concept definition syntax" "" { target *-*-* } .-1 }
  concept void foo();  // { dg-error "3:a concept cannot be a member function" }
  // { dg-error "concept definition syntax" "" { target *-*-* } .-1 }
  concept ~S();  // { dg-error "3:a destructor cannot be .concept." }
  // { dg-error "concept definition syntax" "" { target *-*-* } .-1 }
};

typedef concept int my_int;  // { dg-error "9:.concept. cannot appear in a typedef declaration" }
// { dg-error "concept definition syntax" "" { target *-*-* } .-1 }

void bar(concept int);  // { dg-error "10:a parameter cannot be declared .concept." }
// { dg-error "concept definition syntax" "" { target *-*-* } .-1 }

concept int i = 0;  // { dg-error "1:a non-template variable cannot be .concept." }
// { dg-error "concept definition syntax" "" { target *-*-* } .-1 }