aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/addrfunc1.C18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/addrfunc1.C b/gcc/testsuite/g++.old-deja/g++.ext/addrfunc1.C
new file mode 100644
index 0000000..3e254e6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/addrfunc1.C
@@ -0,0 +1,18 @@
+// Test that taking the address of a member function name produces
+// a pointer to member function.
+// Contributed by Jason Merrill <jason@cygnus.com>
+// Special g++ Options: -fpermissive -w
+// Build don't link:
+
+struct A { };
+int (A::*p)();
+
+struct B {
+ int f () { return 0; }
+ void g ();
+};
+
+void B::g ()
+{
+ p = (int (A::*)())&f;
+}