diff options
author | Alexandre Oliva <oliva@dcc.unicamp.br> | 1998-10-07 20:41:38 +0000 |
---|---|---|
committer | Alexandre Oliva <oliva@gcc.gnu.org> | 1998-10-07 20:41:38 +0000 |
commit | b01c911dca4ba05df22d93ee4120a2b59cae9000 (patch) | |
tree | 3fd506f56cb1c0794e135a6bce02b34a1993b73e /gcc | |
parent | 05714a4ffd3d40cc4e69e5fce3864fc892def8bb (diff) | |
download | gcc-b01c911dca4ba05df22d93ee4120a2b59cae9000.zip gcc-b01c911dca4ba05df22d93ee4120a2b59cae9000.tar.gz gcc-b01c911dca4ba05df22d93ee4120a2b59cae9000.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/init7.C | 30 |
2 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f038a88..310ee0e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +1998-10-08 Alexandre Oliva <oliva@dcc.unicamp.br> + + * 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 <wilson@cygnus.com> * 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 0000000..9a3d5d0 --- /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(); +} |