summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p9206.C
blob: a5452e133a849615dbc78ef528dbc67bfdde58b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// { dg-do run  }
// prms-id: 9206

class X {
public:
  void xtest() { }
};

class Y { };

typedef void (X::*Xptr)();
typedef void (Y::*Yptr)();

int main() {
  X xx;

  Xptr xp = &X::xtest;
  Yptr yp = reinterpret_cast<Yptr>(xp);
  xp = reinterpret_cast<Xptr>(yp);

  (xx.*xp)();
}