Blame SOURCES/gcc48-pr62258.patch

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