2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / ambig3.C
blob3b14e75c78f324fafc2bd76d8811765db0ff6835
1 // { dg-do assemble  }
3 // Copyright (C) 2000 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 23 June 2000 <nathan@codesourcery.com>
6 // Origin GNATS bug report 69 from Glenn Ammons <ammons@cs.wisc.edu>
7 // 
8 // A base which derives a virtual base hides declarations in the virtual base,
9 // even if that virtual base is accessible via another path [10.2]/6. Make
10 // sure that non-virtual bases of the virtual base are also hidden, not matter
11 // what order bases are declared in.
13 struct A {int a;};
14 struct B : A {};
16 struct L1 : virtual B { int a; };
17 struct L2 : virtual A { int a; };
19 struct R1 : virtual B {};
20 struct R2 : virtual A {};
22 struct C1 : R1, L1 {};
23 struct C2 : R2, L2 {};
25 struct D1 : L1, R1 {};
26 struct D2 : L2, R2 {};
28 void fn (C1 *c1, D1 *d1, C2 *c2, D2 *d2)
30   c1->a = 1;
31   d1->a = 1;
32   c2->a = 1;
33   d2->a = 1;