From: Martin v. Löwis Date: Tue, 21 Sep 1999 19:51:16 +0000 (+0000) Subject: New test case. X-Git-Tag: prereleases/libstdc++-2.92~10458 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=54965141fbe2d622a744c83782e75038d6a7e656;p=thirdparty%2Fgcc.git New test case. From-SVN: r29561 --- diff --git a/gcc/testsuite/g++.old-deja/g++.martin/pmf2.C b/gcc/testsuite/g++.old-deja/g++.martin/pmf2.C new file mode 100644 index 000000000000..481fe2cb8658 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.martin/pmf2.C @@ -0,0 +1,21 @@ +// Special g++ Options: -Wno-pmf-conversions +// Test conversion of pointers to virtual member functions to +// pointers to non-member functions. + +struct A{ + int i; + A::A():i(1){} + virtual void foo(); +}a; + +void A::foo() +{ + i = 0; +} + +int main() +{ + void (*f)(A*) = (void(*)(A*))(&A::foo); + f(&a); + return a.i; +}