summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/mi1.C
blob: e5f01c4d6213a6053fd3ab77e4c64cf987c1664c (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
35
36
37
38
39
40
41
42
43
44
45
// { dg-do run  }
// { dg-options "-w" }

class A {
public:
  virtual ~A(){};
  virtual int type(void) {
    return -1;
  }
};

class B : public A {
public:
  virtual ~B(){};
};


class C0 : public B, public virtual A {
public:
  virtual int type(void) {
    return 0;
  }
};

class C1 : public C0
{
public:
  virtual int type(void) {
    return 1;
  }
};

class C2 : public C0 {
public:
  virtual int type(void) {
    return 2;
  }
};

main() {
  C1 *one = new C1;
  
  if (one->type() != 1)
    return 1;
}