summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p3068.C
blob: 65dab70b0864a2e14145cfa8d6b6c743f25a8e50 (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
// { dg-do run  }
// prms-id: 3068

extern "C" int printf(const char *, ...);
extern "C" void exit(int);
 
class LB {
public:
  virtual int test() { return 0; }
  virtual ~LB() { }
protected:
  LB() { }
};

class RRB {
public:
  virtual ~RRB() { }
  virtual void test2(int a) { }
};

class RR : public RRB {
public:
    virtual ~RR() { }
};

class RL {
public:
  virtual void real(int a) {
    printf("RL::real\n");
  }
};


class R : public RL, public RR {
public:
  virtual void test3(int a) { }
  virtual void test2(int a) { }
};

class L : public LB {
};

class C : public L, public R {
public:
  C() { }
  virtual ~C() {
    printf("C::~C\n");
    exit(1);
  }
  virtual void real(int a) {
    printf("RL::real\n");
  }
};

int main() {
    C& bb = *new C;
    R& mv = bb;
    bb.real(0);
    mv.real(0);
    return 0;
}