diff mbox

std::rethrow_exception is broken

Message ID 20140331181722.GH13192@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely March 31, 2014, 6:17 p.m. UTC
On 29/03/14 19:55 +0100, Daniel Krügler wrote:
>2014-03-28 13:37 GMT+01:00 Jonathan Wakely <jwakely@redhat.com>:
>> On 27/03/14 23:00 +0100, Daniel Krügler wrote:
>>> I'm in favour for changing it, what about something like
>>>
>>> "layout mismatch"
>>>
>>> ?
>> How about this?
>>
>> "__cxa_dependent_exception::termHandler layout must be consistent with
>__cxa_exception::termHandler"
>
>Yes, this seems even better to me.

This improves the static assertion messages, as suggested by François
and Daniel.

Tested x86_64-linux, committed to trunk.
commit f92ce7260937614a7897d9890c022812794f793b
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Mar 12 21:36:53 2014 +0000

    2014-03-12  Lars Gullik Bj??nnes  <larsbj@gullik.org>
    	    Jonathan Wakely  <jwakely@redhat.com>
    
    	PR libstdc++/60270
    	* include/std/iomanip (_Quoted_string operator>>): Do not clear
    	string if input is not quoted.
    	* testsuite/27_io/manipulators/standard/char/60270.cc: New.
diff mbox

Patch

diff --git a/libstdc++-v3/include/std/iomanip b/libstdc++-v3/include/std/iomanip
index b2c7b95..73822db 100644
--- a/libstdc++-v3/include/std/iomanip
+++ b/libstdc++-v3/include/std/iomanip
@@ -415,8 +415,6 @@  _GLIBCXX_END_NAMESPACE_VERSION
 		 const _Quoted_string<basic_string<_CharT, _Traits, _Alloc>&,
 				      _CharT>& __str)
       {
-	__str._M_string.clear();
-
 	_CharT __c;
 	__is >> __c;
 	if (!__is.good())
@@ -427,6 +425,7 @@  _GLIBCXX_END_NAMESPACE_VERSION
 	    __is >> __str._M_string;
 	    return __is;
 	  }
+	__str._M_string.clear();
 	std::ios_base::fmtflags __flags
 	  = __is.flags(__is.flags() & ~std::ios_base::skipws);
 	do
diff --git a/libstdc++-v3/testsuite/27_io/manipulators/standard/char/60270.cc b/libstdc++-v3/testsuite/27_io/manipulators/standard/char/60270.cc
new file mode 100644
index 0000000..b2b213b
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/manipulators/standard/char/60270.cc
@@ -0,0 +1,38 @@ 
+// { dg-do run }
+// { dg-options "-std=gnu++14" }
+
+// Copyright (C) 2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// 27.7.6 - Quoted manipulators		[quoted.manip]
+
+// libstdc++/60270
+
+#include <string>
+#include <sstream>
+#include <iomanip>
+#include <testsuite_hooks.h>
+
+int main()
+{
+  std::istringstream in;
+  std::string s = "xxx";
+  in >> s;
+  VERIFY( !s.empty() );
+  in >> std::quoted(s);
+  VERIFY( !s.empty() );
+}

commit aeebd7a5d8e91d309070757e9732127e28527512
Author: redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Mon Mar 31 18:16:14 2014 +0000

    	* libsupc++/eh_ptr.cc: Improve static_assert messages.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208965 138bc75d-0d04-0410-961f-82ee72b054a4

diff --git a/libstdc++-v3/libsupc++/eh_ptr.cc b/libstdc++-v3/libsupc++/eh_ptr.cc
index 8c25a81..f974309 100644
--- a/libstdc++-v3/libsupc++/eh_ptr.cc
+++ b/libstdc++-v3/libsupc++/eh_ptr.cc
@@ -48,7 +48,8 @@  template<typename Ex>
 
 static_assert( termHandler<__cxa_exception>()
 	       == termHandler<__cxa_dependent_exception>(),
-	       "__cxa_dependent_exception::termHandler layout is correct" );
+	       "__cxa_dependent_exception::termHandler layout must be"
+	       " consistent with __cxa_exception::termHandler" );
 
 #ifndef __ARM_EABI_UNWINDER__
 template<typename Ex>
@@ -57,7 +58,8 @@  template<typename Ex>
 
 static_assert( adjptr<__cxa_exception>()
 	       == adjptr<__cxa_dependent_exception>(),
-	       "__cxa_dependent_exception::adjustedPtr layout is correct" );
+	       "__cxa_dependent_exception::adjustedPtr layout must be"
+	       " consistent with __cxa_exception::adjustedPtr" );
 #endif
 }