diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.ext/addrfunc1.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.ext/addrfunc1.C | 18 |
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 000000000..3fec371c2 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.ext/addrfunc1.C @@ -0,0 +1,18 @@ +// { dg-do assemble } +// { dg-options "-fms-extensions" } +// Test that taking the address of a member function name produces +// a pointer to member function. +// Contributed by Jason Merrill <jason@cygnus.com> + +struct A { }; +int (A::*p)(); + +struct B { + int f () { return 0; } + void g (); +}; + +void B::g () +{ + p = (int (A::*)())&f; +} |