@@ -64,7 +64,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 292. effects of a.copyfmt (a)
- if (this != &__rhs)
+ if (this != std::__addressof(__rhs))
{
// Per 27.1.1, do not call imbue, yet must trash all caches
// associated with imbue()
@@ -58,7 +58,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
basic_string<_CharT, _Traits, _Alloc>::
swap(basic_string& __s) _GLIBCXX_NOEXCEPT
{
- if (this == &__s)
+ if (this == std::__addressof(__s))
return;
_Alloc_traits::_S_on_swap(_M_get_allocator(), __s._M_get_allocator());
@@ -254,7 +254,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
basic_string<_CharT, _Traits, _Alloc>::
_M_assign(const basic_string& __str)
{
- if (this != &__str)
+ if (this != std::__addressof(__str))
{
const size_type __rsize = __str.length();
const size_type __capacity = capacity();
@@ -95,7 +95,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
deque<_Tp, _Alloc>::
operator=(const deque& __x)
{
- if (&__x != this)
+ if (std::__addressof(__x) != this)
{
#if __cplusplus >= 201103L
if (_Alloc_traits::_S_propagate_on_copy_assign())
@@ -1729,7 +1729,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
operator=(const _Rb_tree& __x)
{
- if (this != &__x)
+ if (this != std::__addressof(__x))
{
// Note that _Key may be a constant type.
#if __cplusplus >= 201103L
@@ -198,7 +198,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
vector<_Tp, _Alloc>::
operator=(const vector<_Tp, _Alloc>& __x)
{
- if (&__x != this)
+ if (std::__addressof(__x) != this)
{
_GLIBCXX_ASAN_ANNOTATE_REINIT;
#if __cplusplus >= 201103L