From: Martin v. Löwis Date: Tue, 21 Sep 1999 19:51:16 +0000 (+0000) Subject: New test case. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=54965141fbe2d622a744c83782e75038d6a7e656;p=gcc.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 00000000000..481fe2cb865 --- /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; +}