]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Enable vstring for wchar_t unconditionally [PR98725]
authorJonathan Wakely <jwakely@redhat.com>
Fri, 8 Oct 2021 13:48:04 +0000 (14:48 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 8 Oct 2021 23:57:49 +0000 (00:57 +0100)
None of these vstring specializations depend on libc support for
wchar_t, so can be enabled unconditionally now that char_traits<wchar_t>
is always available.

libstdc++-v3/ChangeLog:

PR libstdc++/98725
* include/ext/rc_string_base.h [!_GLIBCXX_USE_WCHAR_T]
(__rc_string_base<wchar_t>): Define member function.
* include/ext/vstring.h [!_GLIBCXX_USE_WCHAR_T]
(hash<__gnu_cxx::__wvstring>): Define specialization.
* include/ext/vstring_fwd.h [!_GLIBCXX_USE_WCHAR_T] (__wvstring)
(__wsso_string, __wrc_string): Declare typedefs.

libstdc++-v3/include/ext/rc_string_base.h
libstdc++-v3/include/ext/vstring.h
libstdc++-v3/include/ext/vstring_fwd.h

index 819f52dc91411b4db142ca07f114d5249eae8f02..88cc656448a04e19cf6ca6517d325d4163606f7e 100644 (file)
@@ -719,7 +719,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       return false;
     }
 
-#ifdef _GLIBCXX_USE_WCHAR_T
   template<>
     inline bool
     __rc_string_base<wchar_t, std::char_traits<wchar_t>,
@@ -730,7 +729,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        return true;
       return false;
     }
-#endif
 
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
index db02af18cb1c52615ff92c81fc025ad98ae6d5ad..cb5872a7030fbe92777641f3eda39a88c728dcdf 100644 (file)
@@ -2921,7 +2921,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       { return std::_Hash_impl::hash(__s.data(), __s.length()); }
     };
 
-#ifdef _GLIBCXX_USE_WCHAR_T
   /// std::hash specialization for __wvstring.
   template<>
     struct hash<__gnu_cxx::__wvstring>
@@ -2932,7 +2931,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       { return std::_Hash_impl::hash(__s.data(),
                                      __s.length() * sizeof(wchar_t)); }
     };
-#endif
 
   /// std::hash specialization for __u16vstring.
   template<>
index 645c328104fa04bcd624cb15541509655191af94..1aa53fdc24a33de24234ba796c6d6dcefd15375c 100644 (file)
@@ -58,13 +58,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   __versa_string<char, std::char_traits<char>,
                 std::allocator<char>, __rc_string_base>    __rc_string;
 
-#ifdef _GLIBCXX_USE_WCHAR_T
   typedef __versa_string<wchar_t>                           __wvstring;
   typedef __wvstring                                        __wsso_string;
   typedef
   __versa_string<wchar_t, std::char_traits<wchar_t>,
                 std::allocator<wchar_t>, __rc_string_base> __wrc_string;
-#endif  
 
 #if __cplusplus >= 201103L
   typedef __versa_string<char16_t>                          __u16vstring;