Debian Codegraph @

gcc/testsuite/g++.dg/lookup/using29.C

raw
1 // { dg-do compile }
2
3 struct A
4 {
5 int i;
6 };
7
8 struct B
9 {
10 int i;
11 };
12
13 struct C : A, B
14 {
15 using A::i; // { dg-message "previous" }
16 using B::i; // { dg-error "redeclaration" }
17 };
18
19 struct E
20 {
21 typedef int type;
22 };
23
24 struct F
25 {
26 typedef int type;
27 };
28
29 struct G : E, F
30 {
31 using E::type; // { dg-message "previous" }
32 using F::type; // { dg-error "redeclaration" }
33 };
34
35 struct H
36 {
37 typedef int type;
38 };
39
40 struct I : H
41 {
42 typedef int type; // { dg-message "previous" }
43 using H::type; // { dg-error "conflicts" }
44 };
45
46 struct I2 : H
47 {
48 using H::type; // { dg-message "previous" }
49 typedef int type; // { dg-error "conflicts" }
50 };
51
52 struct J
53 {
54 struct type {}; // { dg-message "previous" }
55 };
56
57 struct K : J
58 {
59 struct type {}; // { dg-message "previous" }
60 using J::type; // { dg-error "conflicts" }
61 };
62
63 struct L : J
64 {
65 using J::type;
66 struct type {}; // { dg-error "redefinition" }
67 };
68
69 struct M
70 {
71 typedef int type;
72 struct type2 {};
73 };
74
75 struct N : M
76 {
77 using M::type; // { dg-message "previous" }
78 using M::type; // { dg-error "redeclaration" }
79 using M::type2; // { dg-message "previous" }
80 using M::type2; // { dg-error "redeclaration" }
81 };