Patchwork Add missing __throw_exception_again

login
register
mail settings
Submitter Andreas Schwab
Date March 9, 2012, 7:01 p.m.
Message ID <m2boo5tx83.fsf@igel.home>
Download mbox | patch
Permalink /patch/145751/
State New
Headers show

Comments

Andreas Schwab - March 9, 2012, 7:01 p.m.
This makes the 22_locale/locale/cons/12352.cc test fail everywhere.

Andreas.

2012-03-09  Andreas Schwab  <schwab@linux-m68k.org>

	* config/locale/gnu/monetary_members.cc
	(moneypunct<char,true>::_M_initialize_moneypunct): Throw caught
	exception again.
	(moneypunct<char,false>::_M_initialize_moneypunct): Likewise.

testsuite/
	* testsuite/22_locale/locale/cons/12352.cc: Also test en_US
	locale.
---
 libstdc++-v3/config/locale/gnu/monetary_members.cc |    4 +++-
 .../testsuite/22_locale/locale/cons/12352.cc       |    4 ++++
 2 files changed, 7 insertions(+), 1 deletion(-)
Paolo Carlini - March 9, 2012, 7:09 p.m.
On 03/09/2012 08:01 PM, Andreas Schwab wrote:
> This makes the 22_locale/locale/cons/12352.cc test fail everywhere.
Excellent. Thus Ok mainline and 4_7-branch with the testcase extension too.

Thanks again,
Paolo.

Patch

diff --git a/libstdc++-v3/config/locale/gnu/monetary_members.cc b/libstdc++-v3/config/locale/gnu/monetary_members.cc
index 214c4af..d1d9939 100644
--- a/libstdc++-v3/config/locale/gnu/monetary_members.cc
+++ b/libstdc++-v3/config/locale/gnu/monetary_members.cc
@@ -1,6 +1,6 @@ 
 // std::moneypunct implementation details, GNU version -*- C++ -*-
 
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -339,6 +339,7 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	      delete [] __group;
 	      delete [] __ps;
 	      delete [] __ns;
+	      __throw_exception_again;
 	    }
 
 	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
@@ -489,6 +490,7 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	      delete [] __group;
 	      delete [] __ps;
 	      delete [] __ns;
+	      __throw_exception_again;
 	    }
 
 	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
diff --git a/libstdc++-v3/testsuite/22_locale/locale/cons/12352.cc b/libstdc++-v3/testsuite/22_locale/locale/cons/12352.cc
index f56bf67..0449bf3 100644
--- a/libstdc++-v3/testsuite/22_locale/locale/cons/12352.cc
+++ b/libstdc++-v3/testsuite/22_locale/locale/cons/12352.cc
@@ -1,4 +1,5 @@ 
 // { dg-require-namedlocale "" }
+// { dg-require-namedlocale "en_US" }
 
 // Copyright (C) 2003, 2005, 2009 Free Software Foundation
 //
@@ -105,6 +106,9 @@  void test01(int iters)
 	      std::locale loc1 = std::locale("");
 	      std::locale loc2(loc1, std::locale::classic(),
 			       std::locale::numeric);
+	      std::locale loc3 = std::locale("en_US");
+	      std::locale loc4(loc3, std::locale::classic(),
+			       std::locale::numeric);
 	    }
 	  catch (std::exception&)
 	    {