OSDN Git Service

* g++.old-deja/g++.other/init5.C: Remove xfail for powerpc-linux.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.other / vbase1.C
1 // { dg-do run  }
2 // { dg-options "-w" }
3 // Origin: Mark Mitchell <mark@codesourcery.com>
4
5 int result;
6
7 struct A {
8   A ();
9
10   int i;
11 };
12
13 A* ap;
14
15 A::A ()
16 {
17   ap = this;
18 }
19
20 struct B : virtual public A
21 {
22   B ();
23   ~B ();
24
25   int j;
26 };
27
28 B::B () {
29   if ((A*) this != ap)
30     result = 1;
31 }
32
33 B::~B () {
34   if ((A*) this != ap)
35     result = 1;
36 }
37
38 struct C : public B {
39 };
40
41 struct D : public C, public B
42 {
43 };
44
45 int main ()
46 {
47   {
48     D d;
49   }
50
51   return result;
52 }