|
|
22033d |
2015-09-03 Jonathan Wakely <jwakely@redhat.com>
|
|
|
22033d |
|
|
|
22033d |
Backport from mainline
|
|
|
22033d |
2015-04-27 Dmitry Prokoptsev <dprokoptsev@gmail.com>
|
|
|
22033d |
Michael Hanselmann <public@hansmi.ch>
|
|
|
22033d |
|
|
|
22033d |
PR libstdc++/62258
|
|
|
22033d |
* libsupc++/eh_ptr.cc (rethrow_exception): Increment count of
|
|
|
22033d |
uncaught exceptions.
|
|
|
22033d |
* testsuite/18_support/exception_ptr/62258.cc: New.
|
|
|
22033d |
|
|
|
22033d |
--- libstdc++-v3/libsupc++/eh_ptr.cc (revision 227455)
|
|
|
22033d |
+++ libstdc++-v3/libsupc++/eh_ptr.cc (revision 227456)
|
|
|
22033d |
@@ -245,6 +245,9 @@ std::rethrow_exception(std::exception_pt
|
|
|
22033d |
__GXX_INIT_DEPENDENT_EXCEPTION_CLASS(dep->unwindHeader.exception_class);
|
|
|
22033d |
dep->unwindHeader.exception_cleanup = __gxx_dependent_exception_cleanup;
|
|
|
22033d |
|
|
|
22033d |
+ __cxa_eh_globals *globals = __cxa_get_globals ();
|
|
|
22033d |
+ globals->uncaughtExceptions += 1;
|
|
|
22033d |
+
|
|
|
22033d |
#ifdef _GLIBCXX_SJLJ_EXCEPTIONS
|
|
|
22033d |
_Unwind_SjLj_RaiseException (&dep->unwindHeader);
|
|
|
22033d |
#else
|
|
|
22033d |
--- libstdc++-v3/testsuite/18_support/exception_ptr/62258.cc (revision 0)
|
|
|
22033d |
+++ libstdc++-v3/testsuite/18_support/exception_ptr/62258.cc (revision 227456)
|
|
|
22033d |
@@ -0,0 +1,61 @@
|
|
|
22033d |
+// { dg-options "-std=gnu++11" }
|
|
|
22033d |
+// { dg-require-atomic-builtins "" }
|
|
|
22033d |
+
|
|
|
22033d |
+// Copyright (C) 2015 Free Software Foundation, Inc.
|
|
|
22033d |
+//
|
|
|
22033d |
+// This file is part of the GNU ISO C++ Library. This library is free
|
|
|
22033d |
+// software; you can redistribute it and/or modify it under the
|
|
|
22033d |
+// terms of the GNU General Public License as published by the
|
|
|
22033d |
+// Free Software Foundation; either version 3, or (at your option)
|
|
|
22033d |
+// any later version.
|
|
|
22033d |
+
|
|
|
22033d |
+// This library is distributed in the hope that it will be useful,
|
|
|
22033d |
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
22033d |
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
22033d |
+// GNU General Public License for more details.
|
|
|
22033d |
+
|
|
|
22033d |
+// You should have received a copy of the GNU General Public License along
|
|
|
22033d |
+// with this library; see the file COPYING3. If not see
|
|
|
22033d |
+// <http://www.gnu.org/licenses/>.
|
|
|
22033d |
+
|
|
|
22033d |
+// PR libstdc++/62258
|
|
|
22033d |
+
|
|
|
22033d |
+#include <exception>
|
|
|
22033d |
+#include <testsuite_hooks.h>
|
|
|
22033d |
+
|
|
|
22033d |
+struct check_on_destruct
|
|
|
22033d |
+{
|
|
|
22033d |
+ ~check_on_destruct();
|
|
|
22033d |
+};
|
|
|
22033d |
+
|
|
|
22033d |
+check_on_destruct::~check_on_destruct()
|
|
|
22033d |
+{
|
|
|
22033d |
+ VERIFY(std::uncaught_exception());
|
|
|
22033d |
+}
|
|
|
22033d |
+
|
|
|
22033d |
+int main ()
|
|
|
22033d |
+{
|
|
|
22033d |
+ VERIFY(!std::uncaught_exception());
|
|
|
22033d |
+
|
|
|
22033d |
+ try
|
|
|
22033d |
+ {
|
|
|
22033d |
+ check_on_destruct check;
|
|
|
22033d |
+
|
|
|
22033d |
+ try
|
|
|
22033d |
+ {
|
|
|
22033d |
+ throw 1;
|
|
|
22033d |
+ }
|
|
|
22033d |
+ catch (...)
|
|
|
22033d |
+ {
|
|
|
22033d |
+ VERIFY(!std::uncaught_exception());
|
|
|
22033d |
+
|
|
|
22033d |
+ std::rethrow_exception(std::current_exception());
|
|
|
22033d |
+ }
|
|
|
22033d |
+ }
|
|
|
22033d |
+ catch (...)
|
|
|
22033d |
+ {
|
|
|
22033d |
+ VERIFY(!std::uncaught_exception());
|
|
|
22033d |
+ }
|
|
|
22033d |
+
|
|
|
22033d |
+ VERIFY(!std::uncaught_exception());
|
|
|
22033d |
+}
|