summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/net39.C
blob: 6554b335935310f0106e8b84f56217ca9cf14f7b (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
// { dg-do run  }
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)();
}