New test case.
authorMartin v. Löwis <loewis@gcc.gnu.org>
Sat, 18 Sep 1999 10:45:56 +0000 (10:45 +0000)
committerMartin v. Löwis <loewis@gcc.gnu.org>
Sat, 18 Sep 1999 10:45:56 +0000 (10:45 +0000)
From-SVN: r29493

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

diff --git a/gcc/testsuite/g++.old-deja/g++.martin/pmf1.C b/gcc/testsuite/g++.old-deja/g++.martin/pmf1.C
new file mode 100644 (file)
index 0000000..5c6bb54
--- /dev/null
@@ -0,0 +1,18 @@
+// Based on a test case by Andrew Bell <andrew.bell@bigfoot.com>
+// Check for pointer-to-virtual-function calls on 
+// bases without virtual functions.
+
+struct B{};
+
+struct D:B{
+  virtual void foo();
+};
+
+void D::foo(){}
+
+int main()
+{
+  B *b = new D;
+  void (B::*f)() = static_cast<void (B::*)()>(&D::foo);
+  (b->*f)();
+}