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
This commit is contained in:
Alexandre Oliva 1998-10-07 20:41:38 +00:00 committed by Alexandre Oliva
parent 05714a4ffd
commit b01c911dca
2 changed files with 35 additions and 0 deletions

View File

@ -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.

View File

@ -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();
}