aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin v. Löwis <loewis@gcc.gnu.org>1999-09-21 19:51:16 +0000
committerMartin v. Löwis <loewis@gcc.gnu.org>1999-09-21 19:51:16 +0000
commit54965141fbe2d622a744c83782e75038d6a7e656 (patch)
treeaa72fccd04286b4297946418a762728623ee088f /gcc
parent118a6ea13475356ce68262a1218a9eeceb5b57ff (diff)
downloadgcc-54965141fbe2d622a744c83782e75038d6a7e656.zip
gcc-54965141fbe2d622a744c83782e75038d6a7e656.tar.gz
gcc-54965141fbe2d622a744c83782e75038d6a7e656.tar.bz2
New test case.
From-SVN: r29561
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.martin/pmf2.C21
1 files changed, 21 insertions, 0 deletions
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;
+}