Hi

Might still be fine to do now.

    libstdc++: [_Hashtable] Use std::addressof in post-C++11 code

    There is no need to use std::__addressof in post-C++11 code.

    libstdc++-v3/ChangeLog:

            * include/bits/hashtable.h: Replace usages of std::__addressof with
            std::addressof.
            * include/bits/hashtable_policy.h: Likewise.

Tested under Linux x86_64

Ok to commit ?

François

diff --git a/libstdc++-v3/include/bits/hashtable.h 
b/libstdc++-v3/include/bits/hashtable.h
index f4211eba516..eff6c31d827 100644
--- a/libstdc++-v3/include/bits/hashtable.h
+++ b/libstdc++-v3/include/bits/hashtable.h
@@ -1716,7 +1716,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
               _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::
     _M_move_assign(_Hashtable&& __ht, true_type)
     {
-      if (__builtin_expect(std::__addressof(__ht) == this, false))
+      if (__builtin_expect(std::addressof(__ht) == this, false))
        return;
 
       this->_M_deallocate_nodes(_M_begin());
@@ -2345,7 +2345,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
            if constexpr (__is_key_type<_Args...>)
              {
                const auto& __key = _ExtractKey{}(__args...);
-               __kp = std::__addressof(__key);
+               __kp = std::addressof(__key);
              }
          }
        else if constexpr (sizeof...(_Args) == 2)
@@ -2354,7 +2354,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
              {
                pair<const _Args&...> __refs(__args...);
                const auto& __key = _ExtractKey{}(__refs);
-               __kp = std::__addressof(__key);
+               __kp = std::addressof(__key);
              }
          }
 
@@ -2368,7 +2368,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
            __node._M_node
                  = this->_M_allocate_node(std::forward<_Args>(__args)...);
            const key_type& __key = _ExtractKey{}(__node._M_node->_M_v());
-           __kp = std::__addressof(__key);
+           __kp = std::addressof(__key);
          }
 
        if (auto __loc = _M_locate(*__kp))
diff --git a/libstdc++-v3/include/bits/hashtable_policy.h 
b/libstdc++-v3/include/bits/hashtable_policy.h
index 79c36e4a02b..6e4b365d592 100644
--- a/libstdc++-v3/include/bits/hashtable_policy.h
+++ b/libstdc++-v3/include/bits/hashtable_policy.h
@@ -777,7 +777,7 @@ namespace __detail
       typename _RehashPolicy::_State _M_prev_state;
 
       _RehashStateGuard(_RehashPolicy& __policy)
-      : _M_guarded_obj(std::__addressof(__policy))
+      : _M_guarded_obj(std::addressof(__policy))
       , _M_prev_state(__policy._M_state())
       { }
       _RehashStateGuard(const _RehashStateGuard&) = delete;
@@ -1252,7 +1252,7 @@ namespace __detail
 
       void
       _M_init(const _Hash& __h)
-      { std::_Construct(std::__addressof(__hash_obj_storage::_M_u._M_h), __h); 
}
+      { std::_Construct(std::addressof(__hash_obj_storage::_M_u._M_h), __h); }
 
       void
       _M_destroy() { __hash_obj_storage::_M_u._M_h.~_Hash(); }

Reply via email to