mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-04 20:00:30 +08:00
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
This commit is contained in:
parent
fb1b37c797
commit
c38628062d
@ -1,3 +1,10 @@
|
||||
2004-02-08 Richard Henderson <rth@redhat.com>
|
||||
|
||||
PR libstdc++/14026
|
||||
* libsupc++/eh_catch.cc (__cxa_begin_catch): Don't adjust
|
||||
uncaughtExceptions during nested catch rethrow.
|
||||
* testsuite/18_support/14026.cc: New.
|
||||
|
||||
2004-02-08 Paolo Carlini <pcarlini@suse.de>
|
||||
|
||||
* include/bits/basic_string.tcc (assign(const _CharT*, size_type)):
|
||||
|
@ -1,5 +1,5 @@
|
||||
// -*- C++ -*- Exception handling routines for catching.
|
||||
// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of GCC.
|
||||
//
|
||||
@ -65,10 +65,12 @@ __cxa_begin_catch (void *exc_obj_in)
|
||||
// This exception was rethrown from an immediately enclosing region.
|
||||
count = -count + 1;
|
||||
else
|
||||
count += 1;
|
||||
{
|
||||
count += 1;
|
||||
globals->uncaughtExceptions -= 1;
|
||||
}
|
||||
header->handlerCount = count;
|
||||
|
||||
globals->uncaughtExceptions -= 1;
|
||||
if (header != prev)
|
||||
{
|
||||
header->nextException = prev;
|
||||
|
34
libstdc++-v3/testsuite/18_support/14026.cc
Normal file
34
libstdc++-v3/testsuite/18_support/14026.cc
Normal file
@ -0,0 +1,34 @@
|
||||
// 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 ();
|
||||
}
|
Loading…
Reference in New Issue
Block a user