Blame SOURCES/gcc48-pr62258.patch

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