summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p3139.C
blob: 69101785951da8cb236645dd97d51218971eda17 (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
// { dg-do run  }
// prms-id: 3139

extern "C" int printf(const char *, ...);

class A {
  public:
  A() { }
  virtual int a() = 0;
};

class B : virtual public A {
  public:
  virtual int a() = 0;
};

class C : public B {
  public:
  int a() { return 42; }
};

int main() {
  B * b = new C;
  printf("%d.\n", b->a());
  return 0;
}