From: No Author Date: Wed, 17 Mar 2004 18:19:31 +0000 (+0000) Subject: This commit was manufactured by cvs2svn to create branch X-Git-Tag: releases/gcc-3.3.4~151 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3e7566de65675b38aa53e2540ba2a2cab17edeb;p=thirdparty%2Fgcc.git This commit was manufactured by cvs2svn to create branch 'gcc-3_3-branch'. From-SVN: r79593 --- diff --git a/gcc/testsuite/g++.dg/eh/spec7.C b/gcc/testsuite/g++.dg/eh/spec7.C new file mode 100644 index 000000000000..08586a2af75a --- /dev/null +++ b/gcc/testsuite/g++.dg/eh/spec7.C @@ -0,0 +1,35 @@ +// PR 14535 +// { dg-do run } +// { dg-options "-O -finline" } +// +// Original test case failure required that Raiser constructor be inlined. + +extern "C" void abort(); +bool destructor_called = false; + +struct B { + virtual void Run(){}; +}; + +struct D : public B { + virtual void Run() + { + struct O { + ~O() { destructor_called = true; }; + } o; + + struct Raiser { + Raiser() throw( int ) {throw 1;}; + } raiser; + }; +}; + +int main() { + try { + D d; + static_cast(d).Run(); + } catch (...) {} + + if (!destructor_called) + abort (); +}