Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.old-deja/g++.mike/p9206.C @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // { dg-do run } |
2 // prms-id: 9206 | |
3 | |
4 class X { | |
5 public: | |
6 void xtest() { } | |
7 }; | |
8 | |
9 class Y { }; | |
10 | |
11 typedef void (X::*Xptr)(); | |
12 typedef void (Y::*Yptr)(); | |
13 | |
14 int main() { | |
15 X xx; | |
16 | |
17 Xptr xp = &X::xtest; | |
18 Yptr yp = reinterpret_cast<Yptr>(xp); | |
19 xp = reinterpret_cast<Xptr>(yp); | |
20 | |
21 (xx.*xp)(); | |
22 } |