From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 62B7F385780B for ; Fri, 15 Oct 2021 17:28:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 62B7F385780B 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-114-mtYigHikM1q2cUmRyXMtFg-1; Fri, 15 Oct 2021 13:28:01 -0400 X-MC-Unique: mtYigHikM1q2cUmRyXMtFg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 78BD580365C; Fri, 15 Oct 2021 17:28:00 +0000 (UTC) Received: from localhost (unknown [10.33.36.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 26C3468360; Fri, 15 Oct 2021 17:27:59 +0000 (UTC) Date: Fri, 15 Oct 2021 18:27:59 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Remove unused functions in std::variant implementation Message-ID: MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="vTNHdbbOAEIO+g/v" Content-Disposition: inline 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=unavailable autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2021 17:28:06 -0000 --vTNHdbbOAEIO+g/v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline These functions aren't used, and accessing the storage as a void* isn't compatible with C++20 constexpr requirements anyway, so we're unlikely to ever start using them in future. libstdc++-v3/ChangeLog: * include/std/variant (_Variant_storage::_M_storage()): Remove. (__detail::__variant::__get_storage): Remove. (variant): Remove friend declaration of __get_storage. Tested powerpc64le-linux. Committed to trunk. --vTNHdbbOAEIO+g/v Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" commit 1ba7adabf29eb671e418692fad076ea6edd08e3d Author: Jonathan Wakely Date: Fri Oct 15 11:52:08 2021 libstdc++: Remove unused functions in std::variant implementation These functions aren't used, and accessing the storage as a void* isn't compatible with C++20 constexpr requirements anyway, so we're unlikely to ever start using them in future. libstdc++-v3/ChangeLog: * include/std/variant (_Variant_storage::_M_storage()): Remove. (__detail::__variant::__get_storage): Remove. (variant): Remove friend declaration of __get_storage. diff --git a/libstdc++-v3/include/std/variant b/libstdc++-v3/include/std/variant index b85a89d0b7b..4a6826b7ba6 100644 --- a/libstdc++-v3/include/std/variant +++ b/libstdc++-v3/include/std/variant @@ -434,13 +434,6 @@ namespace __variant ~_Variant_storage() { _M_reset(); } - void* - _M_storage() const noexcept - { - return const_cast(static_cast( - std::addressof(_M_u))); - } - constexpr bool _M_valid() const noexcept { @@ -472,13 +465,6 @@ namespace __variant void _M_reset() noexcept { _M_index = static_cast<__index_type>(variant_npos); } - void* - _M_storage() const noexcept - { - return const_cast(static_cast( - std::addressof(_M_u))); - } - constexpr bool _M_valid() const noexcept { @@ -809,11 +795,6 @@ namespace __variant : _FUN_type<_Tp, _Variant> { }; - // Returns the raw storage for __v. - template - void* __get_storage(_Variant&& __v) noexcept - { return __v._M_storage(); } - template struct _Extra_visit_slot_needed { @@ -1690,10 +1671,6 @@ namespace __variant friend constexpr decltype(auto) __detail::__variant::__get(_Vp&& __v) noexcept; - template - friend void* - __detail::__variant::__get_storage(_Vp&& __v) noexcept; - #define _VARIANT_RELATION_FUNCTION_TEMPLATE(__OP) \ template \ friend constexpr bool \ --vTNHdbbOAEIO+g/v--