summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p6610b.C
blob: 664a0ca03cf959534aeb8e605e0b0b71e1a071ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// { dg-do run  }
// prms-id: 6610

int fail = 1;
struct B;
struct A { virtual int f(const B*) = 0; int g(const B*); };
int A::g(const B* t) { return f(t); }
struct B : virtual A { int f(const B*); B* B_this; };
int B::f(const B* t) { return t == this; }
struct S1 { };
struct C : virtual S1, virtual B, virtual A { C(); };
C::C() { if (g(this)) fail = 0; }
struct D : virtual B, virtual A, C { };

int main() { D d; return fail; }