This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[Q] destructors vs terminate
- To: gcc at gcc dot gnu dot org
- Subject: [Q] destructors vs terminate
- From: Richard Henderson <rth at redhat dot com>
- Date: Fri, 3 Aug 2001 16:51:18 -0700
Should the following test case pass? If so, there's some
holes that'll want patching in libsupc++...
r~
#include <exception>
#include <cstdlib>
static void exit_ok () { std::exit (0); }
static void exit_err () { std::exit (1); }
struct A
{
~A()
{
std::set_terminate (exit_err);
throw 1;
}
};
int main ()
{
std::set_terminate (exit_ok);
try
{
A obj;
throw 1;
}
catch (...)
{
}
std::abort ();
}