new
authorJason Merrill <jason@gcc.gnu.org>
Wed, 14 Apr 1999 12:20:06 +0000 (08:20 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 14 Apr 1999 12:20:06 +0000 (08:20 -0400)
From-SVN: r26453

gcc/testsuite/g++.old-deja/g++.ext/addrfunc1.C [new file with mode: 0644]

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 (file)
index 0000000..3e254e6
--- /dev/null
@@ -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;
+}