gcc/testsuite/g++.old-deja/g++.law/bad-error7.C
raw| 1 | // { dg-do assemble } |
| 2 | // { dg-skip-if "requires hosted libstdc++ for iostream" { ! hostedlib } } |
| 3 | // GROUPS passed bad-errors |
| 4 | #include <iostream> |
| 5 | |
| 6 | class ParX |
| 7 | { |
| 8 | public: |
| 9 | ParX() {} |
| 10 | }; |
| 11 | |
| 12 | class X : public ParX |
| 13 | { |
| 14 | public: |
| 15 | void fn2() { std::cout << "hi" << std::endl; } |
| 16 | }; |
| 17 | |
| 18 | int main() |
| 19 | { |
| 20 | X x; |
| 21 | ParX* pParX = &x; |
| 22 | void (ParX::*p)() = (void (ParX::*)()) &X::fn2; // line 19 |
| 23 | |
| 24 | (pParX->*p)(); |
| 25 | } |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 |