summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/lookup4.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/lookup4.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup4.C22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup4.C b/gcc/testsuite/g++.old-deja/g++.other/lookup4.C
new file mode 100644
index 000000000..8fa296892
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup4.C
@@ -0,0 +1,22 @@
+// { dg-do run }
+// Test for proper handling of references to overloaded member functions.
+
+struct A {
+ static void f (int) { }
+ void f ();
+};
+
+void (*p)(int) = &A::f;
+
+void A::f ()
+{
+ p = f;
+}
+
+int main()
+{
+ A a;
+ p = &a.f;
+ (a.f)();
+ (a.f)(42);
+}