2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / init / ctor2.C
blobcf426f2bf16c36661e5f655a640852ec0629067d
1 // { dg-do run }
3 // Copyright (C) 2003 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 14 Mar 2003 <nathan@codesourcery.com>
6 // PR 9629. The vtable is not set up until the base initializers have
7 // run.
9 struct A {
10   static A *a;
11   A ();
13 A *A::a;
14 A::A () {a = this;}
16 struct B {
17   static A *a;
18   B (A *);
20 A *B::a;
21 B::B(A *a_) {a = a_;}
23 struct C : virtual public A, public B {
24   C();
26 C::C () : B(this) {}
28 struct D : virtual public C {};
30 int main()
32   new D();
33   return A::a != B::a;