gcc/libstdc++-v3/testsuite/18_support/14026.cc
Richard Henderson c38628062d re PR libstdc++/14026 (std::uncaught_exception is true although there are no uncaught exceptions (rethrow, ghost exception))
PR libstdc++/14026
        * libsupc++/eh_catch.cc (__cxa_begin_catch): Don't adjust
        uncaughtExceptions during nested catch rethrow.
        * testsuite/18_support/14026.cc: New.

From-SVN: r77492
2004-02-08 10:01:23 -08:00

35 lines
396 B
C++

// PR 14026
// 18.6.4 uncaught_exception
#include <cstdlib>
#include <exception>
#include <testsuite_hooks.h>
static void
no_uncaught ()
{
if (std::uncaught_exception ())
abort ();
}
int
main ()
{
try
{
throw 1;
}
catch (...)
{
try
{
throw;
}
catch (...)
{
no_uncaught ();
}
}
no_uncaught ();
}