gcc/testsuite/g++.old-deja/g++.pt/ptrmem4.C
raw| 1 | // { dg-do link } |
| 2 | |
| 3 | template<class T,class T1> |
| 4 | int connect_to_method(T* receiver, |
| 5 | int (T1::*method)()) |
| 6 | { |
| 7 | return (receiver->*method)(); |
| 8 | } |
| 9 | |
| 10 | class Gtk_Container |
| 11 | { |
| 12 | public: |
| 13 | int remove_callback() { return 1; } |
| 14 | void remove_callback(int); |
| 15 | int f(); |
| 16 | }; |
| 17 | |
| 18 | int Gtk_Container::f() |
| 19 | { |
| 20 | return connect_to_method(this, &Gtk_Container::remove_callback); |
| 21 | } |
| 22 | |
| 23 | int main() |
| 24 | { |
| 25 | Gtk_Container gc; |
| 26 | if (gc.f () != 1) |
| 27 | return 1; |
| 28 | } |