gcc/testsuite/g++.old-deja/g++.mike/p3041.C
raw| 1 | // { dg-do run } |
| 2 | // prms-id: 3041 |
| 3 | |
| 4 | class A { |
| 5 | public: |
| 6 | A() { } |
| 7 | virtual void a() = 0; |
| 8 | static int b(A * p) { |
| 9 | p->a(); |
| 10 | return 1; |
| 11 | } |
| 12 | }; |
| 13 | |
| 14 | class B : virtual public A { |
| 15 | public: |
| 16 | B() { |
| 17 | static int installed = b(this); |
| 18 | } |
| 19 | void a() { } |
| 20 | }; |
| 21 | |
| 22 | class C : virtual public B { |
| 23 | public: |
| 24 | C() { |
| 25 | static int installed = b(this); |
| 26 | } |
| 27 | void a() { } |
| 28 | }; |
| 29 | |
| 30 | int main() |
| 31 | { |
| 32 | C c; |
| 33 | return 0; |
| 34 | } |