PR c++/41174
PR c++/59224
* libsupc++/eh_throw.cc (__cxa_throw): Set uncaughtExceptions.
* libsupc++/eh_alloc.cc (__cxa_allocate_dependent_exception)
(__cxa_allocate_exception): Don't set it here.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@208991
138bc75d-0d04-0410-961f-
82ee72b054a4
static Check const data[] = {
{ 0, 0, false }, // construct [0]
- { 1, 0, true }, // [1] = [0]
+ { 1, 0, false }, // [1] = [0]
{ 0, 0, true }, // destruct [0]
{ 2, 1, true }, // [2] = [1]
{ 2, 2, true }, // destruct [2]
--- /dev/null
+// PR c++/41174
+// { dg-do run }
+
+#include <exception>
+
+#define assert(E) if (!(E)) __builtin_abort();
+
+struct e {
+ e()
+ {
+ assert( !std::uncaught_exception() );
+ try {
+ throw 1;
+ } catch (int i) {
+ assert( !std::uncaught_exception() );
+ throw;
+ }
+ }
+};
+
+int main()
+{
+ try {
+ throw e();
+ } catch (int i) {
+ assert( !std::uncaught_exception() );
+ }
+ assert( !std::uncaught_exception() );
+}
+2014-04-01 Jason Merrill <jason@redhat.com>
+
+ Core DR 475
+ PR c++/41174
+ PR c++/59224
+ * libsupc++/eh_throw.cc (__cxa_throw): Set uncaughtExceptions.
+ * libsupc++/eh_alloc.cc (__cxa_allocate_dependent_exception)
+ (__cxa_allocate_exception): Don't set it here.
+
2014-03-25 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/60658
std::terminate ();
}
- // We have an uncaught exception as soon as we allocate memory. This
- // yields uncaught_exception() true during the copy-constructor that
- // initializes the exception object. See Issue 475.
- __cxa_eh_globals *globals = __cxa_get_globals ();
- globals->uncaughtExceptions += 1;
-
memset (ret, 0, sizeof (__cxa_refcounted_exception));
return (void *)((char *)ret + sizeof (__cxa_refcounted_exception));
std::terminate ();
}
- // We have an uncaught exception as soon as we allocate memory. This
- // yields uncaught_exception() true during the copy-constructor that
- // initializes the exception object. See Issue 475.
- __cxa_eh_globals *globals = __cxa_get_globals ();
- globals->uncaughtExceptions += 1;
-
memset (ret, 0, sizeof (__cxa_dependent_exception));
return ret;
__cxxabiv1::__cxa_throw (void *obj, std::type_info *tinfo,
void (_GLIBCXX_CDTOR_CALLABI *dest) (void *))
{
+ __cxa_eh_globals *globals = __cxa_get_globals ();
+ globals->uncaughtExceptions += 1;
+
// Definitely a primary.
__cxa_refcounted_exception *header
= __get_refcounted_exception_header_from_obj (obj);