1 struct base
2 {
3 enum mode : short { in, out, top, bottom };
4 enum state { pass, fail, unknown };
5 typedef long int_type;
6 };
7
8 struct A : public base
9 {
10 int_type _M_i;
11 int_type _M_n;
12 mode _M_type;
13 };
14
15 struct B : public base
16 {
17 mode _M_type;
18 state _M_state;
19 };
20
21 struct C1 : public base
22 {
23 mode _M_type;
24 };
25
26 struct C2 : virtual public base
27 {
28 mode _M_type;
29 };
30
31 struct C3 : public base
32 {
33 mode _M_type;
34
~C3C335 virtual ~C3() { };
36 };
37
38 struct C4 : public base
39 {
40 mode _M_type;
41
42 virtual void foo() = 0;
43 };
44
45 struct D1 : public A
46 {
47 int_type _M_index;
48 int_type* _M_array;
49 bool _M_ok;
50 };
51
52 struct D2 : public C1
53 {
54 state _M_state;
55 int_type _M_index;
56 int_type* _M_array;
57 bool _M_ok;
58 };
59
60 struct D3 : public C1
61 {
62 int_type _M_index;
63 int_type* _M_array;
64 };
65
66 struct D2v : virtual public C2
67 {
68 state _M_state;
69 int_type _M_index;
70 int_type* _M_array;
71 bool _M_ok;
72 };
73
74 struct D3v : virtual public C3
75 {
76 int_type _M_index;
77 int_type* _M_array;
78 };
79
80 struct D4v : public C4
81 {
82 int_type _M_index;
83 int_type* _M_array;
84
fooD4v85 void foo() { }
86 };
87
88 struct D5v1 : virtual public C3
89 {
90 int_type _M_index;
91 };
92
93 struct D5v2 : virtual public C3
94 {
95 int_type _M_index;
96 };
97
98 // test
99 struct Dd1 : public A, public B
100 { };
101
102 struct Dd2 : public A, public D4v
103 { };
104
105 struct Dd3 : public D2, public D3
106 { };
107
108 struct Dd4 : public D2v, public D3v
109 { };
110
111 struct Dd5 : public D5v1, public D5v2
112 { };
113
114
main()115 int main()
116 {
117 Dd1 obj1;
118 Dd2 obj2;
119 Dd3 obj3;
120 Dd4 obj4;
121 Dd5 obj5;
122 return 0;
123 }
124