]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR libstdc++/37522 (Incorrect vswprintf prototype breaks __to_xstring)
authorJonathan Wakely <jwakely@redhat.com>
Thu, 28 May 2015 16:27:46 +0000 (17:27 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 28 May 2015 16:27:46 +0000 (17:27 +0100)
Backport from mainline
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.

From-SVN: r223840

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/basic_string.h

index 6ac5a48077937757caa19316c422feb47a45dd32..4c34eb21cbc387046c95836f005c5f41ccc07ad1 100644 (file)
@@ -1,3 +1,13 @@
+2015-05-28  Jonathan Wakely  <jwakely@redhat.com>
+
+       Backport from mainline
+       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.
+
 2015-05-22  David Edelsohn  <dje.gcc@gmail.com>
 
        Backport from mainline
index 89189656bcda55bae803e8765cc4ab1d1b983be5..a629390c789643893d2d8be4dbebf485c4d50e16 100644 (file)
@@ -2844,8 +2844,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 _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>
 
@@ -2995,6 +2994,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   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)
@@ -3056,6 +3056,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf, __n,
                                            L"%Lf", __val);
   }
+#endif // _GLIBCXX_HAVE_BROKEN_VSWPRINTF
 #endif
 
 _GLIBCXX_END_NAMESPACE_VERSION