aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/net39.C
blob: 00ad1c6bc02b6104d4149c84c6c985e38c002d70 (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
void *vp;

class silly {
public:
  virtual int b() { return 1; }
};
class solly : silly {
public:
  virtual int b() { return 2; }
};
class thing {
public:
  virtual int a() { return 3; }
};
class thong : public solly, public thing {
public:
  virtual int a() {
    if (this != vp) return 4;
    else return 0;
  }
};

typedef int(thing::*ping)();
ping qq = &thing::a;

int main() {
  thong b;
  vp = &b;
  return (b.*qq)();
}