mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-01-31 09:39:40 +08:00
35 lines
396 B
C++
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 ();
|
||
|
}
|