Commit b01c911d by Alexandre Oliva Committed by Alexandre Oliva

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
parent 05714a4f
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.
......
// 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();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment