gcc/testsuite/g++.old-deja/g++.other/pmf7.C
raw| 1 | // { dg-do assemble } |
| 2 | // Test for proper diagnostics on trying to take the address of a non-static |
| 3 | // member function. |
| 4 | |
| 5 | struct A { |
| 6 | void f (); |
| 7 | void f (int); |
| 8 | void g (); |
| 9 | }; |
| 10 | |
| 11 | int main () |
| 12 | { |
| 13 | A a; |
| 14 | &a.f; // { dg-error "" } overloaded |
| 15 | &a.g; // { dg-error "6:ISO C\\+\\+ forbids taking the address of a bound member function" } can't write a pmf like this |
| 16 | } |