From 54965141fbe2d622a744c83782e75038d6a7e656 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Tue, 21 Sep 1999 19:51:16 +0000 Subject: [PATCH] New test case. From-SVN: r29561 --- gcc/testsuite/g++.old-deja/g++.martin/pmf2.C | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.martin/pmf2.C 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 0000000..481fe2c --- /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; +} -- 2.7.4