]> gcc.gnu.org Git - gcc.git/commitdiff
libstdc++: Remove unused functions in std::variant implementation
authorJonathan Wakely <jwakely@redhat.com>
Fri, 15 Oct 2021 10:52:08 +0000 (11:52 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 7 Jul 2022 17:23:14 +0000 (18:23 +0100)
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)

libstdc++-v3/include/std/variant

index c0585cb5999a0f9dc2264a67c7d553c6039466f9..f101c4267447c3c48f99a506e35ce6e34a90e30e 100644 (file)
@@ -435,13 +435,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
       {
@@ -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<void*>(static_cast<const void*>(
-           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<typename _Variant>
-    void* __get_storage(_Variant&& __v) noexcept
-    { return __v._M_storage(); }
-
   template <typename _Maybe_variant_cookie, typename _Variant>
     struct _Extra_visit_slot_needed
     {
@@ -1685,10 +1666,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 \
This page took 0.099343 seconds and 5 git commands to generate.