summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p3041.C
blob: 189d2f3ba4de2647e8991c6e50e5bbb5fed76e04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// { dg-do run  }
// prms-id: 3041

class A {
public:
  A() { }
  virtual void a() = 0;
  static int b(A * p) {
    p->a();
    return 1;
  }
};

class B : virtual public A {
public:
  B() {
    static int installed = b(this);
  }
  void a() { }
};

class C : virtual public B {
public:
  C() {
    static int installed = b(this);
  }
  void a() { }
};

int main()
{
  C c;
  return 0;
}