1// { dg-do assemble } 2 3// Copyright (C) 2000 Free Software Foundation, Inc. 4// Contributed by Nathan Sidwell 23 June 2000 <nathan@codesourcery.com> 5 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. 12 13struct A {int a;}; 14struct B : A {}; 15 16struct L1 : virtual B { int a; }; 17struct L2 : virtual A { int a; }; 18 19struct R1 : virtual B {}; 20struct R2 : virtual A {}; 21 22struct C1 : R1, L1 {}; 23struct C2 : R2, L2 {}; 24 25struct D1 : L1, R1 {}; 26struct D2 : L2, R2 {}; 27 28void 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} 35