Commit | Line | Data |
---|---|---|
c906108c SS |
1 | class A { |
2 | public: | |
3 | int a; | |
4 | int aa; | |
5 | ||
6 | A() | |
7 | { | |
8 | a=1; | |
9 | aa=2; | |
10 | } | |
11 | int afoo(); | |
12 | int foo(); | |
13 | ||
14 | }; | |
15 | ||
16 | ||
17 | ||
18 | class B { | |
19 | public: | |
20 | int b; | |
21 | int bb; | |
22 | ||
23 | B() | |
24 | { | |
25 | b=3; | |
26 | bb=4; | |
27 | } | |
28 | int bfoo(); | |
29 | int foo(); | |
30 | ||
31 | }; | |
32 | ||
33 | ||
34 | ||
35 | class C { | |
36 | public: | |
37 | int c; | |
38 | int cc; | |
39 | ||
40 | C() | |
41 | { | |
42 | c=5; | |
43 | cc=6; | |
44 | } | |
45 | int cfoo(); | |
46 | int foo(); | |
47 | ||
48 | }; | |
49 | ||
50 | ||
51 | ||
52 | class D : private A, public B, protected C { | |
53 | public: | |
54 | int d; | |
55 | int dd; | |
56 | ||
57 | D() | |
58 | { | |
59 | d =7; | |
60 | dd=8; | |
61 | } | |
62 | int dfoo(); | |
63 | int foo(); | |
64 | ||
65 | }; | |
66 | ||
67 | ||
68 | class E : public A, B, protected C { | |
69 | public: | |
70 | int e; | |
71 | int ee; | |
72 | ||
73 | E() | |
74 | { | |
75 | e =9; | |
76 | ee=10; | |
77 | } | |
78 | int efoo(); | |
79 | int foo(); | |
80 | ||
81 | }; | |
82 | ||
83 | ||
84 | class F : A, public B, C { | |
85 | public: | |
86 | int f; | |
87 | int ff; | |
88 | ||
89 | F() | |
90 | { | |
91 | f =11; | |
92 | ff=12; | |
93 | } | |
94 | int ffoo(); | |
95 | int foo(); | |
96 | ||
97 | }; | |
98 | ||
99 | class G : private A, public B, protected C { | |
100 | public: | |
101 | int g; | |
102 | int gg; | |
103 | int a; | |
104 | int b; | |
105 | int c; | |
106 | ||
107 | G() | |
108 | { | |
109 | g =13; | |
110 | gg =14; | |
111 | a=15; | |
112 | b=16; | |
113 | c=17; | |
114 | ||
115 | } | |
116 | int gfoo(); | |
117 | int foo(); | |
118 | ||
119 | }; | |
120 | ||
7977e5d2 TT |
121 | class V_base |
122 | { | |
123 | public: | |
124 | virtual void m(); | |
125 | int base; | |
126 | }; | |
127 | ||
128 | void | |
129 | V_base::m() | |
130 | { | |
131 | } | |
c906108c | 132 | |
7977e5d2 TT |
133 | class V_inter : public virtual V_base |
134 | { | |
135 | public: | |
136 | virtual void f(); | |
137 | int inter; | |
138 | }; | |
139 | ||
140 | void | |
141 | V_inter::f() | |
142 | { | |
143 | } | |
144 | ||
145 | class V_derived : public V_inter | |
146 | { | |
147 | public: | |
148 | double x; | |
149 | }; | |
c906108c | 150 | |
7977e5d2 | 151 | V_derived vderived; |
c906108c SS |
152 | |
153 | int A::afoo() { | |
154 | return 1; | |
155 | } | |
156 | ||
157 | int B::bfoo() { | |
158 | return 2; | |
159 | } | |
160 | ||
161 | int C::cfoo() { | |
162 | return 3; | |
163 | } | |
164 | ||
165 | int D::dfoo() { | |
166 | return 4; | |
167 | } | |
168 | ||
169 | int E::efoo() { | |
170 | return 5; | |
171 | } | |
172 | ||
173 | int F::ffoo() { | |
174 | return 6; | |
175 | } | |
176 | ||
177 | int G::gfoo() { | |
178 | return 77; | |
179 | } | |
180 | ||
181 | int A::foo() | |
182 | { | |
183 | return 7; | |
184 | ||
185 | } | |
186 | ||
187 | int B::foo() | |
188 | { | |
189 | return 8; | |
190 | ||
191 | } | |
192 | ||
193 | int C::foo() | |
194 | { | |
195 | return 9; | |
196 | ||
197 | } | |
198 | ||
199 | int D::foo() | |
200 | { | |
201 | return 10; | |
202 | ||
203 | } | |
204 | ||
205 | int E::foo() | |
206 | { | |
207 | return 11; | |
208 | ||
209 | } | |
210 | ||
211 | int F::foo() | |
212 | { | |
213 | return 12; | |
214 | ||
215 | } | |
216 | ||
217 | int G::foo() | |
218 | { | |
219 | return 13; | |
220 | ||
221 | } | |
222 | ||
223 | ||
224 | void marker1() | |
225 | { | |
226 | } | |
227 | ||
228 | ||
229 | int main(void) | |
230 | { | |
231 | ||
232 | A a_instance; | |
233 | B b_instance; | |
234 | C c_instance; | |
235 | D d_instance; | |
236 | E e_instance; | |
237 | F f_instance; | |
238 | G g_instance; | |
239 | ||
93201743 | 240 | marker1(); // marker1-returns-here |
c906108c | 241 | |
93201743 | 242 | a_instance.a = 20; // marker1-returns-here |
c906108c SS |
243 | a_instance.aa = 21; |
244 | b_instance.b = 22; | |
245 | b_instance.bb = 23; | |
246 | c_instance.c = 24; | |
247 | c_instance.cc = 25; | |
248 | d_instance.d = 26; | |
249 | d_instance.dd = 27; | |
250 | e_instance.e = 28; | |
251 | e_instance.ee =29; | |
252 | f_instance.f =30; | |
253 | f_instance.ff =31; | |
254 | ||
255 | ||
256 | ||
257 | ||
258 | return 0; | |
259 | ||
260 | } | |
261 | ||
262 | ||
263 |