From-SVN: r41652
This commit is contained in:
Jason Merrill 2001-04-28 01:11:21 -04:00
parent ad34a822c1
commit d0029fc5be
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,24 @@
// Test that inlining a destructor with a catch block doesn't confuse the
// enclosing try block.
// Special g++ Options: -O
struct A {
~A()
{
try { throw 1; }
catch (...) { }
}
};
int main ()
{
try
{
A a;
throw 42;
}
catch (int i)
{
return (i != 42);
}
}

View File

@ -0,0 +1,16 @@
// Test that an unhandled exception causes us to call terminate.
#include <exception>
#include <cstdlib>
void my_terminate ()
{
std::exit (0);
}
int main (void)
{
std::set_terminate (my_terminate);
throw 1;
return 1;
}