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: [committed] libstdc++: Remove unused functions in std::variant implementation
Date: Fri, 15 Oct 2021 18:27:59 +0100	[thread overview]
Message-ID: <YWm6H4MOLEpNcwEv@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 421 bytes --]

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.


[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 2188 bytes --]

commit 1ba7adabf29eb671e418692fad076ea6edd08e3d
Author: Jonathan Wakely <jwakely@redhat.com>
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<void*>(static_cast<const void*>(
-	    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<void*>(static_cast<const void*>(
-	    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<typename _Variant>
-    void* __get_storage(_Variant&& __v) noexcept
-    { return __v._M_storage(); }
-
   template <typename _Maybe_variant_cookie, typename _Variant>
     struct _Extra_visit_slot_needed
     {
@@ -1690,10 +1671,6 @@ namespace __variant
 	friend constexpr decltype(auto)
 	__detail::__variant::__get(_Vp&& __v) noexcept;
 
-      template<typename _Vp>
-	friend void*
-	__detail::__variant::__get_storage(_Vp&& __v) noexcept;
-
 #define _VARIANT_RELATION_FUNCTION_TEMPLATE(__OP) \
       template<typename... _Tp> \
 	friend constexpr bool \

                 reply	other threads:[~2021-10-15 17:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=YWm6H4MOLEpNcwEv@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).