From: Martin v. Löwis Date: Sat, 18 Sep 1999 10:45:56 +0000 (+0000) Subject: New test case. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e9013db2047dcc0eded38e19ce55a4a409436ebf;p=gcc.git New test case. From-SVN: r29493 --- 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 +// 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(&D::foo); + (b->*f)(); +}