aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin v. Löwis <loewis@gcc.gnu.org>1999-09-18 10:45:56 +0000
committerMartin v. Löwis <loewis@gcc.gnu.org>1999-09-18 10:45:56 +0000
commite9013db2047dcc0eded38e19ce55a4a409436ebf (patch)
tree90646f315908df96bfb4513547c50106b9a60648
parentf3310c0da3a9081dc4bf7ed3b813c7e31194c19d (diff)
downloadgcc-e9013db2047dcc0eded38e19ce55a4a409436ebf.zip
gcc-e9013db2047dcc0eded38e19ce55a4a409436ebf.tar.gz
gcc-e9013db2047dcc0eded38e19ce55a4a409436ebf.tar.bz2
New test case.
From-SVN: r29493
-rw-r--r--gcc/testsuite/g++.old-deja/g++.martin/pmf1.C18
1 files changed, 18 insertions, 0 deletions
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
index 0000000..5c6bb54
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.martin/pmf1.C
@@ -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)();
+}