Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / vbase1.C
blob4392784f94f8d309458d546d625033666cccf422
1 // { dg-do run  }
2 // { dg-options "-w" }
3 // Origin: Mark Mitchell <mark@codesourcery.com>
5 int result;
7 struct A {
8   A ();
10   int i;
13 A* ap;
15 A::A ()
17   ap = this;
20 struct B : virtual public A
22   B ();
23   ~B ();
25   int j;
28 B::B () {
29   if ((A*) this != ap)
30     result = 1;
33 B::~B () {
34   if ((A*) this != ap)
35     result = 1;
38 struct C : public B {
41 struct D : public C, public B
45 int main ()
47   {
48     D d;
49   }
51   return result;