From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id CC07F3850218; Thu, 7 Jul 2022 23:32:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC07F3850218 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r11-10117] libstdc++: Remove unused functions in std::variant implementation X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: 16946c7c823c2d6531ac272d31d68d95d9c30ddd X-Git-Newrev: 80056e27a6e8b3d00a74343bde931d583561ffe9 Message-Id: <20220707233208.CC07F3850218@sourceware.org> Date: Thu, 7 Jul 2022 23:32:08 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2022 23:32:09 -0000 https://gcc.gnu.org/g:80056e27a6e8b3d00a74343bde931d583561ffe9 commit r11-10117-g80056e27a6e8b3d00a74343bde931d583561ffe9 Author: Jonathan Wakely Date: Fri Oct 15 11:52:08 2021 +0100 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. (cherry picked from commit 1ba7adabf29eb671e418692fad076ea6edd08e3d) Diff: --- libstdc++-v3/include/std/variant | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/libstdc++-v3/include/std/variant b/libstdc++-v3/include/std/variant index c0585cb5999..f101c426744 100644 --- a/libstdc++-v3/include/std/variant +++ b/libstdc++-v3/include/std/variant @@ -435,13 +435,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 { @@ -473,13 +466,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 { @@ -804,11 +790,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 { @@ -1685,10 +1666,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 \