New test case.
authorMartin v. Löwis <loewis@gcc.gnu.org>
Tue, 21 Sep 1999 19:51:16 +0000 (19:51 +0000)
committerMartin v. Löwis <loewis@gcc.gnu.org>
Tue, 21 Sep 1999 19:51:16 +0000 (19:51 +0000)
From-SVN: r29561

gcc/testsuite/g++.old-deja/g++.martin/pmf2.C [new file with mode: 0644]

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 (file)
index 0000000..481fe2c
--- /dev/null
@@ -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;
+}