gcc/testsuite/g++.dg/template/operator11.C
raw| 1 | // PR c++/48594 |
| 2 | // Test for uses of (X->*Y)() that don't actually involve a |
| 3 | // pointer to member function. |
| 4 | |
| 5 | struct A { } a; |
| 6 | struct B { } b; |
| 7 | struct C * cp; |
| 8 | |
| 9 | struct Func { void operator()(); }; |
| 10 | Func operator->* (A, int); |
| 11 | |
| 12 | typedef void (*pfn)(); |
| 13 | pfn operator->* (B, int); |
| 14 | |
| 15 | pfn C::*cpfn; |
| 16 | Func C::*cfunc; |
| 17 | |
| 18 | template <class T> |
| 19 | void f() |
| 20 | { |
| 21 | (a->*1)(); |
| 22 | (b->*1)(); |
| 23 | (cp->*cpfn)(); |
| 24 | (cp->*cfunc)(); |
| 25 | } |