1 // { dg-do run } 2 3 // Copyright (C) 2003 Free Software Foundation, Inc. 4 // Contributed by Nathan Sidwell 14 Mar 2003 <nathan@codesourcery.com> 5 6 // PR 9629. The vtable is not set up until the base initializers have 7 // run. 8 9 struct A { 10 static A *a; 11 A (); 12 }; 13 A *A::a; A()14A::A () {a = this;} 15 16 struct B { 17 static A *a; 18 B (A *); 19 }; 20 A *B::a; B(A * a_)21B::B(A *a_) {a = a_;} 22 23 struct C : virtual public A, public B { 24 C(); 25 }; C()26C::C () : B(this) {} 27 28 struct D : virtual public C {}; 29 main()30int main() 31 { 32 new D(); 33 return A::a != B::a; 34 } 35