2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.mike / p6610a.C
blob4870e074d90f88fd956e7d10bebb9aa97d429c05
1 // { dg-do run  }
2 // prms-id: 6610
3 // There is a bug in vtable thunks with multiple/virtual inheritance.
5 int fail = 1;
6 struct B;
7 struct A { virtual int f(const B*) = 0; int g(const B*); };
8 int A::g(const B* t) { return f(t); }
9 struct B : virtual A { B(); int f(const B*); B* B_this; };
10 B::B() { if (g(this)) fail = 0; }
11 int B::f(const B* t) { return t == this; }
12 struct C : B { int f(const B*); int x; };
13 int C::f(const B*) { return 0; }
15 int main() { C c; return fail; }