| 1 |
// { dg-do assemble } |
| 2 |
|
| 3 |
// Copyright (C) 2000 Free Software Foundation, Inc. |
| 4 |
// Contributed by Nathan Sidwell 23 June 2000 <[email protected]> |
| 5 |
|
| 6 |
// Origin GNATS bug report 69 from Glenn Ammons <[email protected]> |
| 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. |
| 12 |
|
| 13 |
struct A {int a;}; |
| 14 |
struct B : A {}; |
| 15 |
|
| 16 |
struct L1 : virtual B { int a; }; |
| 17 |
struct L2 : virtual A { int a; }; |
| 18 |
|
| 19 |
struct R1 : virtual B {}; |
| 20 |
struct R2 : virtual A {}; |
| 21 |
|
| 22 |
struct C1 : R1, L1 {}; |
| 23 |
struct C2 : R2, L2 {}; |
| 24 |
|
| 25 |
struct D1 : L1, R1 {}; |
| 26 |
struct D2 : L2, R2 {}; |
| 27 |
|
| 28 |
void fn (C1 *c1, D1 *d1, C2 *c2, D2 *d2) |
| 29 |
{ |
| 30 |
c1->a = 1; |
| 31 |
d1->a = 1; |
| 32 |
c2->a = 1; |
| 33 |
d2->a = 1; |
| 34 |
} |