summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorloewis <loewis@138bc75d-0d04-0410-961f-82ee72b054a4>1999-09-18 10:45:56 +0000
committerloewis <loewis@138bc75d-0d04-0410-961f-82ee72b054a4>1999-09-18 10:45:56 +0000
commit251b4a90a74fb3b0ea014db0940d1539a118e936 (patch)
tree90646f315908df96bfb4513547c50106b9a60648 /gcc/testsuite
parente6be7dd023411abdb8ddf28673d602b0419c8be2 (diff)
downloadgcc-251b4a90a74fb3b0ea014db0940d1539a118e936.tar.gz
New test case.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29493 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-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 00000000000..5c6bb5403c5
--- /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)();
+}