1 // { dg-do run  }
2 // prms-id: 6610
3 // There is a bug in vtable thunks with multiple/virtual inheritance.
4 
5 int fail = 1;
6 struct B;
7 struct A { virtual int f(const B*) = 0; int g(const B*); };
g(const B * t)8 int A::g(const B* t) { return f(t); }
9 struct B : virtual A { B(); int f(const B*); B* B_this; };
B()10 B::B() { if (g(this)) fail = 0; }
f(const B * t)11 int B::f(const B* t) { return t == this; }
12 struct C : B { int f(const B*); int x; };
f(const B *)13 int C::f(const B*) { return 0; }
14 
main()15 int main() { C c; return fail; }
16