public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [PATCH 4/8] libstdc++: Enable vstring for wchar_t unconditionally [PR98725]
Date: Sat,  9 Oct 2021 01:13:47 +0100	[thread overview]
Message-ID: <20211009001351.659647-4-jwakely@redhat.com> (raw)
In-Reply-To: <20211009001351.659647-1-jwakely@redhat.com>

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 | 2 --
 libstdc++-v3/include/ext/vstring.h        | 2 --
 libstdc++-v3/include/ext/vstring_fwd.h    | 2 --
 3 files changed, 6 deletions(-)

diff --git a/libstdc++-v3/include/ext/rc_string_base.h b/libstdc++-v3/include/ext/rc_string_base.h
index 819f52dc914..88cc656448a 100644
--- a/libstdc++-v3/include/ext/rc_string_base.h
+++ b/libstdc++-v3/include/ext/rc_string_base.h
@@ -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
diff --git a/libstdc++-v3/include/ext/vstring.h b/libstdc++-v3/include/ext/vstring.h
index db02af18cb1..cb5872a7030 100644
--- a/libstdc++-v3/include/ext/vstring.h
+++ b/libstdc++-v3/include/ext/vstring.h
@@ -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<>
diff --git a/libstdc++-v3/include/ext/vstring_fwd.h b/libstdc++-v3/include/ext/vstring_fwd.h
index 645c328104f..1aa53fdc24a 100644
--- a/libstdc++-v3/include/ext/vstring_fwd.h
+++ b/libstdc++-v3/include/ext/vstring_fwd.h
@@ -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;
-- 
2.31.1


  parent reply	other threads:[~2021-10-09  0:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-09  0:13 [committed 1/8] libstdc++: Add missing _GLIBCXX_USE_WCHAR_T checks in testsuite Jonathan Wakely
2021-10-09  0:13 ` [PATCH 2/8] libstdc++: Move test that depends on wchar_t I/O to wchar_t sub-directory Jonathan Wakely
2021-10-09  0:13 ` [PATCH 3/8] libstdc++: Always define typedefs and hash functions for wide strings [PR 98725] Jonathan Wakely
2021-10-09  0:13 ` Jonathan Wakely [this message]
2021-10-09  0:13 ` [PATCH 5/8] libstdc++: Enable type traits for wchar_t unconditionally [PR98725] Jonathan Wakely
2021-10-09  0:13 ` [PATCH 6/8] libstdc++: Define std::wstring_convert unconditionally [PR 98725] Jonathan Wakely
2021-10-09  0:13 ` [PATCH 7/8] libstdc++: Define deleted wchar_t overloads " Jonathan Wakely
2021-10-09  0:13 ` [PATCH 8/8] libstdc++: Remove unnecessary uses of _GLIBCXX_USE_WCHAR_T in testsuite [PR98725] Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211009001351.659647-4-jwakely@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).