aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p10148.C
blob: 36309763fde851af8aa45b1d9953499cb3632698 (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
// prms-id: 10148

int fail = 1;
void ok() { fail = 0; }

class TC {
  int s_;
};

class TIRD {
 public:
  void (*itc)();
  TIRD() { itc = ok; }
};

class TCCB : public TC, public TIRD {
};

class TCRCB : public TCCB {
public:
  virtual void eat ();
};

void TCRCB::eat () {
 void *vp = (TIRD*)this->itc;
 this->itc();
}

main() {
  TCRCB a;
  a.eat();
  return fail;
}