From b01c911dca4ba05df22d93ee4120a2b59cae9000 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Wed, 7 Oct 1998 20:41:38 +0000 Subject: [PATCH] init7.C: New test: retry initialization of static locals if first initialization throws * g++.old-deja/g++.other/init7.C: New test: retry initialization of static locals if first initialization throws From-SVN: r22901 --- gcc/testsuite/ChangeLog | 5 ++++ gcc/testsuite/g++.old-deja/g++.other/init7.C | 30 ++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.other/init7.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f038a885afc..310ee0ed08e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +1998-10-08 Alexandre Oliva + + * g++.old-deja/g++.other/init7.C: New test: retry initialization + of static locals if first initialization throws + Wed Oct 7 12:00:20 1998 Jim Wilson * gcc.c-torture/compile/981007-1.c: New test for irix6 -O0 core dump. diff --git a/gcc/testsuite/g++.old-deja/g++.other/init7.C b/gcc/testsuite/g++.old-deja/g++.other/init7.C new file mode 100644 index 00000000000..9a3d5d03dfa --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/init7.C @@ -0,0 +1,30 @@ +// simplified from testcase in Windows Developer Journal, +// submitted by eyal.ben-david@aks.com + +// The initialization of a static local variable must be retried if a +// previous try finished by throwing an exception [stmt.dcl]/4 + +// execution test - XFAIL *-*-* + +struct foo { + foo() { throw true; } +}; + +void bar() { + static foo baz; +} + +int main() { + try { + bar(); // must throw + } + catch (bool) { + try { + bar(); // must throw again! + } + catch (bool) { + return 0; + } + } + abort(); +} -- 2.30.2