From: Jonathan Wakely Date: Mon, 22 Dec 2014 16:41:39 +0000 (+0000) Subject: re PR libstdc++/37522 (Incorrect vswprintf prototype breaks __to_xstring) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f37f5fb81c7f1a4f9589af2be8f4dc32f43d9d91;p=gcc.git re PR libstdc++/37522 (Incorrect vswprintf prototype breaks __to_xstring) 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 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 4fe8283f96b..29acd975025 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,30 @@ +2014-12-22 Jonathan Wakely + + 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 PR libstdc++/60271 diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h index 77293848b0b..6423c59ede2 100644 --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -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 @@ -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(&std::vswprintf, __n, L"%Lf", __val); } +#endif // _GLIBCXX_HAVE_BROKEN_VSWPRINTF #endif _GLIBCXX_END_NAMESPACE_CXX11 diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/dr1261.cc b/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/dr1261.cc index b9de1cd7745..e7fea9ec933 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/dr1261.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/dr1261.cc @@ -1,5 +1,4 @@ // { dg-options "-std=gnu++11" } -// { dg-require-string-conversions "" } // 2009-11-11 Paolo Carlini diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stod.cc b/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stod.cc index 5e3060c46e4..fa9dedb68ff 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stod.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stod.cc @@ -1,5 +1,4 @@ // { dg-options "-std=gnu++11" } -// { dg-require-string-conversions "" } // 2008-06-15 Paolo Carlini diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stof.cc b/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stof.cc index 607f97be183..16b9fc21763 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stof.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stof.cc @@ -1,5 +1,4 @@ // { dg-options "-std=gnu++11" } -// { dg-require-string-conversions "" } // 2008-06-15 Paolo Carlini diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoi.cc b/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoi.cc index 6c0fb98dca9..1032e6e3c78 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoi.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoi.cc @@ -1,5 +1,4 @@ // { dg-options "-std=gnu++11" } -// { dg-require-string-conversions "" } // 2008-06-15 Paolo Carlini diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stol.cc b/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stol.cc index 9cdb4b0a9f5..df6ad787468 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stol.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stol.cc @@ -1,5 +1,4 @@ // { dg-options "-std=gnu++11" } -// { dg-require-string-conversions "" } // 2008-06-15 Paolo Carlini diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stold.cc b/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stold.cc index 039534cd313..e201780c53b 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stold.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stold.cc @@ -1,5 +1,4 @@ // { dg-options "-std=gnu++11" } -// { dg-require-string-conversions "" } // 2008-06-15 Paolo Carlini diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoll.cc b/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoll.cc index dce8fdf63e9..b5ced9f23e4 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoll.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoll.cc @@ -1,5 +1,4 @@ // { dg-options "-std=gnu++11" } -// { dg-require-string-conversions "" } // 2008-06-15 Paolo Carlini diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoul.cc b/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoul.cc index 9cc2609f286..29c462bdc7a 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoul.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoul.cc @@ -1,5 +1,4 @@ // { dg-options "-std=gnu++11" } -// { dg-require-string-conversions "" } // 2008-06-15 Paolo Carlini diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoull.cc b/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoull.cc index 8a04e07d679..39004316660 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoull.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoull.cc @@ -1,5 +1,4 @@ // { dg-options "-std=gnu++11" } -// { dg-require-string-conversions "" } // 2008-06-15 Paolo Carlini diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/to_string.cc b/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/to_string.cc index 516e6027a71..4f7f75ac97a 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/to_string.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/to_string.cc @@ -1,5 +1,4 @@ // { dg-options "-std=gnu++11" } -// { dg-require-string-conversions "" } // 2008-06-15 Paolo Carlini