[committed] libstdc++: Fix use of newlocale in std:::from_chars

Message ID 20200731133939.GA1249737@redhat.com
State New
Headers show
Series
  • [committed] libstdc++: Fix use of newlocale in std:::from_chars
Related show

Commit Message

Ian Lance Taylor via Gcc-patches July 31, 2020, 1:39 p.m.
libstdc++-v3/ChangeLog:

	* src/c++17/floating_from_chars.cc (from_chars_impl): Use
	LC_ALL_MASK not LC_ALL.

Tested x86_64-linux and powerpc-aix. Committed to trunk.
commit 4143efc1eed44050201b20c78d0206bc266e30c4
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Jul 31 14:36:56 2020

    libstdc++: Fix use of newlocale in std:::from_chars
    
    libstdc++-v3/ChangeLog:
    
            * src/c++17/floating_from_chars.cc (from_chars_impl): Use
            LC_ALL_MASK not LC_ALL.

Patch

diff --git a/libstdc++-v3/src/c++17/floating_from_chars.cc b/libstdc++-v3/src/c++17/floating_from_chars.cc
index 26b69a38521..d52c0a937b9 100644
--- a/libstdc++-v3/src/c++17/floating_from_chars.cc
+++ b/libstdc++-v3/src/c++17/floating_from_chars.cc
@@ -286,7 +286,7 @@  namespace
   ptrdiff_t
   from_chars_impl(const char* str, T& value, errc& ec) noexcept
   {
-    if (locale_t loc = ::newlocale(LC_ALL, "C", (locale_t)0)) [[likely]]
+    if (locale_t loc = ::newlocale(LC_ALL_MASK, "C", (locale_t)0)) [[likely]]
       {
 	locale_t orig = ::uselocale(loc);