summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p1862.C
blob: 7765ec1eaca0482e384d2fe9370cc4640ba8fe95 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// { dg-do run  }
// GROUPS vtable
extern "C" int printf (const char *, ...);

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

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


class C0 : public B, public 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;
  }
};

int main()
{
  C1 *one = new C1;
  
  if (one->type() == 1)
    {
      printf ("PASS\n");
      return 0;
    }
  else
    {
      printf ("FAIL\n");
      return 1;
    }
}