Blame SOURCES/gcc48-pr62258.patch

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