summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/ptrmem4.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/ptrmem4.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/ptrmem4.C28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ptrmem4.C b/gcc/testsuite/g++.old-deja/g++.pt/ptrmem4.C
new file mode 100644
index 000000000..70ac25eb2
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ptrmem4.C
@@ -0,0 +1,28 @@
+// { dg-do link }
+
+template<class T,class T1>
+int connect_to_method(T* receiver,
+ int (T1::*method)())
+{
+ return (receiver->*method)();
+}
+
+class Gtk_Container
+{
+public:
+ int remove_callback() { return 1; }
+ void remove_callback(int);
+ int f();
+};
+
+int Gtk_Container::f()
+{
+ return connect_to_method(this, &Gtk_Container::remove_callback);
+}
+
+int main()
+{
+ Gtk_Container gc;
+ if (gc.f () != 1)
+ return 1;
+}