diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table --- a/libcxx/include/__hash_table +++ b/libcxx/include/__hash_table @@ -298,7 +298,7 @@ __hash_iterator(const __hash_iterator& __i) : __node_(__i.__node_) { - __get_db()->__iterator_copy(this, &__i); + __get_db()->__iterator_copy(this, _VSTD::addressof(__i)); } _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/list b/libcxx/include/list --- a/libcxx/include/list +++ b/libcxx/include/list @@ -330,7 +330,7 @@ __list_iterator(const __list_iterator& __p) : __ptr_(__p.__ptr_) { - __get_db()->__iterator_copy(this, &__p); + __get_db()->__iterator_copy(this, _VSTD::addressof(__p)); } _LIBCPP_INLINE_VISIBILITY @@ -342,9 +342,9 @@ _LIBCPP_INLINE_VISIBILITY __list_iterator& operator=(const __list_iterator& __p) { - if (this != &__p) + if (this != _VSTD::addressof(__p)) { - __get_db()->__iterator_copy(this, &__p); + __get_db()->__iterator_copy(this, _VSTD::addressof(__p)); __ptr_ = __p.__ptr_; } return *this; @@ -448,7 +448,7 @@ : __ptr_(__p.__ptr_) { #if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__iterator_copy(this, &__p); + __get_db()->__iterator_copy(this, _VSTD::addressof(__p)); #endif } @@ -458,7 +458,7 @@ __list_const_iterator(const __list_const_iterator& __p) : __ptr_(__p.__ptr_) { - __get_db()->__iterator_copy(this, &__p); + __get_db()->__iterator_copy(this, _VSTD::addressof(__p)); } _LIBCPP_INLINE_VISIBILITY @@ -1536,7 +1536,7 @@ typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type*) { #if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, + _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this, "list::insert(iterator, range) called with an iterator not" " referring to this list"); iterator __r(__p.__ptr_, this); @@ -1842,10 +1842,10 @@ list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l) { #if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__f) == this, + _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__f)) == this, "list::erase(iterator, iterator) called with an iterator not" " referring to this list"); - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__l) == this, + _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__l)) == this, "list::erase(iterator, iterator) called with an iterator not" " referring to this list"); #endif diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map --- a/libcxx/include/unordered_map +++ b/libcxx/include/unordered_map @@ -1448,13 +1448,13 @@ #if _LIBCPP_DEBUG_LEVEL == 2 bool __dereferenceable(const const_iterator* __i) const - {return __table_.__dereferenceable(&__i->__i_);} + {return __table_.__dereferenceable(_VSTD::addressof(__i->__i_));} bool __decrementable(const const_iterator* __i) const - {return __table_.__decrementable(&__i->__i_);} + {return __table_.__decrementable(_VSTD::addressof(__i->__i_));} bool __addable(const const_iterator* __i, ptrdiff_t __n) const - {return __table_.__addable(&__i->__i_, __n);} + {return __table_.__addable(_VSTD::addressof(__i->__i_), __n);} bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const - {return __table_.__addable(&__i->__i_, __n);} + {return __table_.__addable(_VSTD::addressof(__i->__i_), __n);} #endif // _LIBCPP_DEBUG_LEVEL == 2 @@ -2250,13 +2250,13 @@ #if _LIBCPP_DEBUG_LEVEL == 2 bool __dereferenceable(const const_iterator* __i) const - {return __table_.__dereferenceable(&__i->__i_);} + {return __table_.__dereferenceable(_VSTD::addressof(__i->__i_));} bool __decrementable(const const_iterator* __i) const - {return __table_.__decrementable(&__i->__i_);} + {return __table_.__decrementable(_VSTD::addressof(__i->__i_));} bool __addable(const const_iterator* __i, ptrdiff_t __n) const - {return __table_.__addable(&__i->__i_, __n);} + {return __table_.__addable(_VSTD::addressof(__i->__i_), __n);} bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const - {return __table_.__addable(&__i->__i_, __n);} + {return __table_.__addable(_VSTD::addressof(__i->__i_), __n);} #endif // _LIBCPP_DEBUG_LEVEL == 2 diff --git a/libcxx/test/std/containers/sequences/list/list.cons/assign_copy.addressof.compile.pass.cpp b/libcxx/test/std/containers/sequences/list/list.cons/assign_copy.addressof.compile.pass.cpp --- a/libcxx/test/std/containers/sequences/list/list.cons/assign_copy.addressof.compile.pass.cpp +++ b/libcxx/test/std/containers/sequences/list/list.cons/assign_copy.addressof.compile.pass.cpp @@ -6,9 +6,6 @@ // //===----------------------------------------------------------------------===// -// Guard the debug iterators against ADL-hijacking. -// XFAIL: LIBCXX-DEBUG-FIXME - // // list& operator=(const list& c); diff --git a/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/assign_copy.addressof.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/assign_copy.addressof.compile.pass.cpp --- a/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/assign_copy.addressof.compile.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/assign_copy.addressof.compile.pass.cpp @@ -6,9 +6,6 @@ // //===----------------------------------------------------------------------===// -// Guard the debug iterators against ADL-hijacking. -// XFAIL: LIBCXX-DEBUG-FIXME - // // template , class Pred = equal_to, diff --git a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_copy.addressof.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_copy.addressof.compile.pass.cpp --- a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_copy.addressof.compile.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_copy.addressof.compile.pass.cpp @@ -6,9 +6,6 @@ // //===----------------------------------------------------------------------===// -// Guard the debug iterators against ADL-hijacking. -// XFAIL: LIBCXX-DEBUG-FIXME - // // template , class Pred = equal_to, diff --git a/libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_copy.addressof.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_copy.addressof.compile.pass.cpp --- a/libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_copy.addressof.compile.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_copy.addressof.compile.pass.cpp @@ -6,9 +6,6 @@ // //===----------------------------------------------------------------------===// -// Guard the debug iterators against ADL-hijacking. -// XFAIL: LIBCXX-DEBUG-FIXME - // // template , class Pred = equal_to, diff --git a/libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/assign_copy.addressof.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/assign_copy.addressof.compile.pass.cpp --- a/libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/assign_copy.addressof.compile.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/assign_copy.addressof.compile.pass.cpp @@ -6,9 +6,6 @@ // //===----------------------------------------------------------------------===// -// Guard the debug iterators against ADL-hijacking. -// XFAIL: LIBCXX-DEBUG-FIXME - // // template , class Pred = equal_to,