[gcc r16-8589] libstdc++: [_Hashtable] Use std::addressof in post-C++11 code
Francois Dumont
fdumont@gcc.gnu.org
Mon Apr 13 20:30:21 GMT 2026
https://gcc.gnu.org/g:f1561d35696a77b968fd0c29bc5c9d9019c7059d
commit r16-8589-gf1561d35696a77b968fd0c29bc5c9d9019c7059d
Author: François Dumont <frs.dumont@gmail.com>
Date: Mon Apr 13 19:30:28 2026 +0200
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.
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Diff:
---
libstdc++-v3/include/bits/hashtable.h | 8 ++++----
libstdc++-v3/include/bits/hashtable_policy.h | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h
index f4211eba516f..eff6c31d8272 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 79c36e4a02bf..6e4b365d5925 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(); }
More information about the Libstdc++-cvs
mailing list