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 00000000000..3e254e6f82b --- /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 +// 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; +}