annotate gcc/testsuite/g++.dg/cpp0x/dc8.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // PR c++/51424
kono
parents:
diff changeset
2 // { dg-do compile { target c++11 } }
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 template <class T >
kono
parents:
diff changeset
5 struct S
kono
parents:
diff changeset
6 {
kono
parents:
diff changeset
7 S() : S() {} // { dg-error "delegates to itself" }
kono
parents:
diff changeset
8 S(int x) : S(x) {} // { dg-error "delegates to itself" }
kono
parents:
diff changeset
9 };
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 struct B1
kono
parents:
diff changeset
12 {
kono
parents:
diff changeset
13 B1() : B1() {} // { dg-error "delegates to itself" }
kono
parents:
diff changeset
14 B1(int y) : B1(y) {} // { dg-error "delegates to itself" }
kono
parents:
diff changeset
15 };
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 struct V1 : virtual B1
kono
parents:
diff changeset
18 {
kono
parents:
diff changeset
19 V1() : B1() {}
kono
parents:
diff changeset
20 V1(int x) : B1(x) {}
kono
parents:
diff changeset
21 };
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 struct B2
kono
parents:
diff changeset
24 {
kono
parents:
diff changeset
25 B2() : B2() {} // { dg-error "delegates to itself" }
kono
parents:
diff changeset
26 B2(int y) : B2(y) {} // { dg-error "delegates to itself" }
kono
parents:
diff changeset
27 };
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 struct V2 : virtual B2
kono
parents:
diff changeset
30 {
kono
parents:
diff changeset
31 V2() : V2() {} // { dg-error "delegates to itself" }
kono
parents:
diff changeset
32 V2(int x) : V2(x) {} // { dg-error "delegates to itself" }
kono
parents:
diff changeset
33 };
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 struct B3
kono
parents:
diff changeset
36 {
kono
parents:
diff changeset
37 B3() {}
kono
parents:
diff changeset
38 B3(int y) {}
kono
parents:
diff changeset
39 };
kono
parents:
diff changeset
40
kono
parents:
diff changeset
41 struct V3 : virtual B3
kono
parents:
diff changeset
42 {
kono
parents:
diff changeset
43 V3() : V3() {} // { dg-error "delegates to itself" }
kono
parents:
diff changeset
44 V3(int x) : V3(x) {} // { dg-error "delegates to itself" }
kono
parents:
diff changeset
45 };
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 struct CE1
kono
parents:
diff changeset
48 {
kono
parents:
diff changeset
49 constexpr CE1() : CE1() {} // { dg-error "delegates to itself" }
kono
parents:
diff changeset
50 constexpr CE1(int x) : CE1(x) {} // { dg-error "delegates to itself" }
kono
parents:
diff changeset
51 };
kono
parents:
diff changeset
52
kono
parents:
diff changeset
53 struct CEB2
kono
parents:
diff changeset
54 {
kono
parents:
diff changeset
55 constexpr CEB2() : CEB2() {} // { dg-error "delegates to itself" }
kono
parents:
diff changeset
56 constexpr CEB2(int x) : CEB2(x) {} // { dg-error "delegates to itself" }
kono
parents:
diff changeset
57 };
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 struct CE2 : CEB2
kono
parents:
diff changeset
60 {
kono
parents:
diff changeset
61 constexpr CE2() : CEB2() {}
kono
parents:
diff changeset
62 constexpr CE2(int x) : CEB2(x) {}
kono
parents:
diff changeset
63 };
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 S<int> s1;
kono
parents:
diff changeset
66 S<int> s2(1);