summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p10148.C
blob: 2cb359c9b9a82a298bf672443db2535a49f4844e (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
// { dg-do run  }
// { dg-options "" }
// 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 = (void *)((TIRD*)this)->itc;
 this->itc();
}

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