Blame SOURCES/gcc48-pr62258.patch

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