From patchwork Sat Oct 9 00:13:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 46020 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 266853857C6E for ; Sat, 9 Oct 2021 00:14:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 266853857C6E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1633738468; bh=sQEm6T8Dw5GUH5CVWlwtdiu4RO2He3aVGmv7dPBCHjI=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=scWlpMgsGJHkCY/idBsDpS9Yx99tjiflGWFm1drpQVHNBjntEUTP2pe8N6bN7AdCL fXLGlZt/fT+dnSSS2DQ12VaOxQ3/HvAo8HLaUEUo5j0PuqBEJIZMdi9Fak5PIdMk17 IvxOXFi8kRFvLXpTIkSg9Zdq4sLKArnRZ8Nlazko= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 6858B385840C for ; Sat, 9 Oct 2021 00:13:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6858B385840C Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-96-goumB9B7PtC1PMjzeLemxA-1; Fri, 08 Oct 2021 20:13:57 -0400 X-MC-Unique: goumB9B7PtC1PMjzeLemxA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 55BAE801AA7; Sat, 9 Oct 2021 00:13:56 +0000 (UTC) Received: from localhost (unknown [10.33.37.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 061635C22B; Sat, 9 Oct 2021 00:13:55 +0000 (UTC) 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 Message-Id: <20211009001351.659647-4-jwakely@redhat.com> In-Reply-To: <20211009001351.659647-1-jwakely@redhat.com> References: <20211009001351.659647-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" None of these vstring specializations depend on libc support for wchar_t, so can be enabled unconditionally now that char_traits is always available. libstdc++-v3/ChangeLog: PR libstdc++/98725 * include/ext/rc_string_base.h [!_GLIBCXX_USE_WCHAR_T] (__rc_string_base): 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, @@ -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, std::allocator, __rc_string_base> __rc_string; -#ifdef _GLIBCXX_USE_WCHAR_T typedef __versa_string __wvstring; typedef __wvstring __wsso_string; typedef __versa_string, std::allocator, __rc_string_base> __wrc_string; -#endif #if __cplusplus >= 201103L typedef __versa_string __u16vstring;