| 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*); }; |
| 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; } |
| 14 |
|
| 15 |
int main() { C c; return fail; } |