URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Subversion Repositories openrisc_2011-10-31
[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [init7.C] - Rev 338
Compare with Previous | Blame | View Log
// { dg-do run }
// 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
extern "C" void abort ();
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();
}