]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Define std::wstring_convert unconditionally [PR 98725]
authorJonathan Wakely <jwakely@redhat.com>
Fri, 8 Oct 2021 13:25:42 +0000 (14:25 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 8 Oct 2021 23:57:49 +0000 (00:57 +0100)
The wchar_t type is defined unconditionally for C++, so there is no
reason for std::wstring_convert and std::wbuffer_convert to be disabled
when <wchar.h> is not usable. It should be possible to use those class
templates with char16_t and char32_t even if wchar_t conversions don't
work.

libstdc++-v3/ChangeLog:

PR libstdc++/98725
* include/bits/locale_conv.h (wstring_convert, wbuffer_convert):
Define unconditionally. Do not check _GLIBCXX_USE_WCHAR_T.

libstdc++-v3/include/bits/locale_conv.h

index 6af8a5bdc8f1a1b16ce2c357f4bc66c8dd567e01..41d17238fbdcb8f18b922080a46e90f7c02e253d 100644 (file)
@@ -253,8 +253,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       };
   }
 
-#ifdef _GLIBCXX_USE_WCHAR_T
-
 _GLIBCXX_BEGIN_NAMESPACE_CXX11
 
   /// String conversions
@@ -626,8 +624,6 @@ _GLIBCXX_END_NAMESPACE_CXX11
       bool                     _M_always_noconv;
     };
 
-#endif  // _GLIBCXX_USE_WCHAR_T
-
   /// @} group locales
 
 _GLIBCXX_END_NAMESPACE_VERSION