Blame SOURCES/gcc48-pr62258.patch

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