re PR libstdc++/37522 (Incorrect vswprintf prototype breaks __to_xstring)
authorJonathan Wakely <jwakely@redhat.com>
Mon, 22 Dec 2014 16:41:39 +0000 (16:41 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 22 Dec 2014 16:41:39 +0000 (16:41 +0000)
PR libstdc++/37522
* include/bits/basic_string.h (stod, stof, stoi, stol, stold, stoll,
stoul, stoull, to_string): Only use _GLIBCXX_HAVE_BROKEN_VSWPRINTF
to guard definition of to_wstring.
* testsuite/21_strings/basic_string/numeric_conversions/char/dr1261.cc:
Do not use dg-require-string-conversions.
* testsuite/21_strings/basic_string/numeric_conversions/char/stod.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/char/stof.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/char/stoi.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/char/stol.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/char/stold.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/char/stoll.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/char/stoul.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/char/
stoull.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/char/
to_string.cc: Likewise.

From-SVN: r219019

12 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/basic_string.h
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/dr1261.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stod.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stof.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoi.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stol.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stold.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoll.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoul.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoull.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/to_string.cc

index 4fe8283f96b82b3a6fd7c4d08f1b9659f4a4b967..29acd9750251dca3d61538c6b6a83da09ebe2126 100644 (file)
@@ -1,3 +1,30 @@
+2014-12-22  Jonathan Wakely  <jwakely@redhat.com>
+
+       PR libstdc++/37522
+       * include/bits/basic_string.h (stod, stof, stoi, stol, stold, stoll,
+       stoul, stoull, to_string): Only use _GLIBCXX_HAVE_BROKEN_VSWPRINTF
+       to guard definition of to_wstring.
+       * testsuite/21_strings/basic_string/numeric_conversions/char/dr1261.cc:
+       Do not use dg-require-string-conversions.
+       * testsuite/21_strings/basic_string/numeric_conversions/char/stod.cc:
+       Likewise.
+       * testsuite/21_strings/basic_string/numeric_conversions/char/stof.cc:
+       Likewise.
+       * testsuite/21_strings/basic_string/numeric_conversions/char/stoi.cc:
+       Likewise.
+       * testsuite/21_strings/basic_string/numeric_conversions/char/stol.cc:
+       Likewise.
+       * testsuite/21_strings/basic_string/numeric_conversions/char/stold.cc:
+       Likewise.
+       * testsuite/21_strings/basic_string/numeric_conversions/char/stoll.cc:
+       Likewise.
+       * testsuite/21_strings/basic_string/numeric_conversions/char/stoul.cc:
+       Likewise.
+       * testsuite/21_strings/basic_string/numeric_conversions/char/
+       stoull.cc: Likewise.
+       * testsuite/21_strings/basic_string/numeric_conversions/char/
+       to_string.cc: Likewise.
+
 2014-12-22  Ville Voutilainen  <ville.voutilainen@gmail.com>
 
        PR libstdc++/60271
index 77293848b0b6fd29fe6826e52aa6af04c6fb1f14..6423c59ede25149e9740e7fc28328d5d1e3bd144 100644 (file)
@@ -5240,8 +5240,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
 
-#if ((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \
-     && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF))
+#if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99)
 
 #include <ext/string_conversions.h>
 
@@ -5392,6 +5391,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
   stold(const wstring& __str, size_t* __idx = 0)
   { return __gnu_cxx::__stoa(&std::wcstold, "stold", __str.c_str(), __idx); }
 
+#ifndef _GLIBCXX_HAVE_BROKEN_VSWPRINTF
   // DR 1261.
   inline wstring
   to_wstring(int __val)
@@ -5453,6 +5453,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
     return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf, __n,
                                            L"%Lf", __val);
   }
+#endif // _GLIBCXX_HAVE_BROKEN_VSWPRINTF
 #endif
 
 _GLIBCXX_END_NAMESPACE_CXX11
index b9de1cd7745f1c533f0cd90263e28a9127667bdb..e7fea9ec933d4d80e11823feceacf47c88ce3e91 100644 (file)
@@ -1,5 +1,4 @@
 // { dg-options "-std=gnu++11" }
-// { dg-require-string-conversions "" }
 
 // 2009-11-11  Paolo Carlini  <paolo.carlini@oracle.com>
 
index 5e3060c46e45d3a99e01b28da76cdb697636f82f..fa9dedb68fff4882a1cc32735b2fbcfa3d33c4d2 100644 (file)
@@ -1,5 +1,4 @@
 // { dg-options "-std=gnu++11" }
-// { dg-require-string-conversions "" }
 
 // 2008-06-15  Paolo Carlini  <paolo.carlini@oracle.com>
 
index 607f97be183e9ea1faaafefd441900c699e7d1d1..16b9fc21763d304a6a28b6d3b02111e78d45e599 100644 (file)
@@ -1,5 +1,4 @@
 // { dg-options "-std=gnu++11" }
-// { dg-require-string-conversions "" }
 
 // 2008-06-15  Paolo Carlini  <paolo.carlini@oracle.com>
 
index 6c0fb98dca95c6ea5d96fa0a30f89f54f822173d..1032e6e3c782979a70853dfa65137bdd6f1cd4ee 100644 (file)
@@ -1,5 +1,4 @@
 // { dg-options "-std=gnu++11" }
-// { dg-require-string-conversions "" }
 
 // 2008-06-15  Paolo Carlini  <paolo.carlini@oracle.com>
 
index 9cdb4b0a9f585cbe9a198a50c486850162ac441a..df6ad7874688f2bec93cc0b6618ac2c1559702b9 100644 (file)
@@ -1,5 +1,4 @@
 // { dg-options "-std=gnu++11" }
-// { dg-require-string-conversions "" }
 
 // 2008-06-15  Paolo Carlini  <paolo.carlini@oracle.com>
 
index 039534cd3133e46161f4788b67e31aa7097f835e..e201780c53b77754bffba6ad93041be1d40298e2 100644 (file)
@@ -1,5 +1,4 @@
 // { dg-options "-std=gnu++11" }
-// { dg-require-string-conversions "" }
 
 // 2008-06-15  Paolo Carlini  <paolo.carlini@oracle.com>
 
index dce8fdf63e9dbec015dd0551837cd82e4c80ebfe..b5ced9f23e407dee64dc8d91b01f9043d98d5a60 100644 (file)
@@ -1,5 +1,4 @@
 // { dg-options "-std=gnu++11" }
-// { dg-require-string-conversions "" }
 
 // 2008-06-15  Paolo Carlini  <paolo.carlini@oracle.com>
 
index 9cc2609f2862042934282bb512cdf454cb86f8b5..29c462bdc7a49c78086589183b637dbdbdb9010b 100644 (file)
@@ -1,5 +1,4 @@
 // { dg-options "-std=gnu++11" }
-// { dg-require-string-conversions "" }
 
 // 2008-06-15  Paolo Carlini  <paolo.carlini@oracle.com>
 
index 8a04e07d679f17d52f8ef23e84160f51d8bf4435..39004316660013ab006f973cdd10014f420cc154 100644 (file)
@@ -1,5 +1,4 @@
 // { dg-options "-std=gnu++11" }
-// { dg-require-string-conversions "" }
 
 // 2008-06-15  Paolo Carlini  <paolo.carlini@oracle.com>
 
index 516e6027a71891de9406794b999f9368fe70aae6..4f7f75ac97aa666132fbfa0118793e2304f61e88 100644 (file)
@@ -1,5 +1,4 @@
 // { dg-options "-std=gnu++11" }
-// { dg-require-string-conversions "" }
 
 // 2008-06-15  Paolo Carlini  <paolo.carlini@oracle.com>