diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table index adc732cffb0159..6b682ab27c6c3e 100644 --- a/libcxx/include/__hash_table +++ b/libcxx/include/__hash_table @@ -308,9 +308,9 @@ public: _LIBCPP_INLINE_VISIBILITY __hash_iterator& operator=(const __hash_iterator& __i) { - if (this != _VSTD::addressof(__i)) + if (this != &__i) { - __get_db()->__iterator_copy(this, _VSTD::addressof(__i)); + __get_db()->__iterator_copy(this, &__i); __node_ = __i.__node_; } return *this; @@ -406,7 +406,7 @@ public: : __node_(__x.__node_) { #if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__iterator_copy(this, _VSTD::addressof(__x)); + __get_db()->__iterator_copy(this, &__x); #endif } @@ -415,7 +415,7 @@ public: __hash_const_iterator(const __hash_const_iterator& __i) : __node_(__i.__node_) { - __get_db()->__iterator_copy(this, _VSTD::addressof(__i)); + __get_db()->__iterator_copy(this, &__i); } _LIBCPP_INLINE_VISIBILITY @@ -427,9 +427,9 @@ public: _LIBCPP_INLINE_VISIBILITY __hash_const_iterator& operator=(const __hash_const_iterator& __i) { - if (this != _VSTD::addressof(__i)) + if (this != &__i) { - __get_db()->__iterator_copy(this, _VSTD::addressof(__i)); + __get_db()->__iterator_copy(this, &__i); __node_ = __i.__node_; } return *this; @@ -523,7 +523,7 @@ public: __bucket_(__i.__bucket_), __bucket_count_(__i.__bucket_count_) { - __get_db()->__iterator_copy(this, _VSTD::addressof(__i)); + __get_db()->__iterator_copy(this, &__i); } _LIBCPP_INLINE_VISIBILITY @@ -535,9 +535,9 @@ public: _LIBCPP_INLINE_VISIBILITY __hash_local_iterator& operator=(const __hash_local_iterator& __i) { - if (this != _VSTD::addressof(__i)) + if (this != &__i) { - __get_db()->__iterator_copy(this, _VSTD::addressof(__i)); + __get_db()->__iterator_copy(this, &__i); __node_ = __i.__node_; __bucket_ = __i.__bucket_; __bucket_count_ = __i.__bucket_count_; @@ -655,7 +655,7 @@ public: __bucket_count_(__x.__bucket_count_) { #if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__iterator_copy(this, _VSTD::addressof(__x)); + __get_db()->__iterator_copy(this, &__x); #endif } @@ -666,7 +666,7 @@ public: __bucket_(__i.__bucket_), __bucket_count_(__i.__bucket_count_) { - __get_db()->__iterator_copy(this, _VSTD::addressof(__i)); + __get_db()->__iterator_copy(this, &__i); } _LIBCPP_INLINE_VISIBILITY @@ -678,9 +678,9 @@ public: _LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator& operator=(const __hash_const_local_iterator& __i) { - if (this != _VSTD::addressof(__i)) + if (this != &__i) { - __get_db()->__iterator_copy(this, _VSTD::addressof(__i)); + __get_db()->__iterator_copy(this, &__i); __node_ = __i.__node_; __bucket_ = __i.__bucket_; __bucket_count_ = __i.__bucket_count_; @@ -1615,7 +1615,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign( __u.size() = 0; } #if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->swap(this, _VSTD::addressof(__u)); + __get_db()->swap(this, &__u); #endif } @@ -2021,7 +2021,7 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi( const_iterator __p, __node_pointer __cp) { - _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this, + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, "unordered container::emplace_hint(const_iterator, args...) called with an iterator not" " referring to this unordered container"); if (__p != end() && key_eq()(*__p, __cp->__value_)) @@ -2148,7 +2148,7 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_hint_multi( const_iterator __p, _Args&&... __args) { - _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this, + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, "unordered container::emplace_hint(const_iterator, args...) called with an iterator not" " referring to this unordered container"); __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...); @@ -2472,7 +2472,7 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator __hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __p) { __next_pointer __np = __p.__node_; - _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this, + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, "unordered container erase(iterator) called with an iterator not" " referring to this container"); _LIBCPP_DEBUG_ASSERT(__p != end(), @@ -2492,10 +2492,10 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator __hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __first, const_iterator __last) { - _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__first)) == this, + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__first) == this, "unordered container::erase(iterator, iterator) called with an iterator not" " referring to this container"); - _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__last)) == this, + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__last) == this, "unordered container::erase(iterator, iterator) called with an iterator not" " referring to this container"); for (const_iterator __p = __first; __first != __last; __p = __first) @@ -2727,7 +2727,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u) __u.__bucket_list_[__constrain_hash(__u.__p1_.first().__next_->__hash(), __u.bucket_count())] = __u.__p1_.first().__ptr(); #if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->swap(this, _VSTD::addressof(__u)); + __get_db()->swap(this, &__u); #endif } diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map index accab28a995923..73edadab209905 100644 --- a/libcxx/include/unordered_map +++ b/libcxx/include/unordered_map @@ -519,7 +519,6 @@ template #include <__functional/is_transparent.h> #include <__hash_table> #include <__iterator/iterator_traits.h> -#include <__memory/addressof.h> #include <__node_handle> #include <__utility/forward.h> #include @@ -1187,7 +1186,7 @@ public: {return __table_.__insert_unique(__x);} iterator insert(const_iterator __p, const value_type& __x) { - _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i()_VSTD::addressof(__p) == this, + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, "unordered_map::insert(const_iterator, const value_type&) called with an iterator not " "referring to this unordered_map"); ((void)__p); @@ -1208,7 +1207,7 @@ public: {return __table_.__insert_unique(_VSTD::move(__x));} iterator insert(const_iterator __p, value_type&& __x) { - _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this, + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, "unordered_map::insert(const_iterator, const value_type&) called with an iterator not" " referring to this unordered_map"); ((void)__p); @@ -1226,7 +1225,7 @@ public: _LIBCPP_INLINE_VISIBILITY iterator insert(const_iterator __p, _Pp&& __x) { - _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this, + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, "unordered_map::insert(const_iterator, value_type&&) called with an iterator not" " referring to this unordered_map"); ((void)__p); @@ -1242,7 +1241,7 @@ public: template _LIBCPP_INLINE_VISIBILITY iterator emplace_hint(const_iterator __p, _Args&&... __args) { - _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this, + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, "unordered_map::emplace_hint(const_iterator, args...) called with an iterator not" " referring to this unordered_map"); ((void)__p); @@ -1274,7 +1273,7 @@ public: _LIBCPP_INLINE_VISIBILITY iterator try_emplace(const_iterator __h, const key_type& __k, _Args&&... __args) { - _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__h)) == this, + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__h) == this, "unordered_map::try_emplace(const_iterator, key, args...) called with an iterator not" " referring to this unordered_map"); ((void)__h); @@ -1285,7 +1284,7 @@ public: _LIBCPP_INLINE_VISIBILITY iterator try_emplace(const_iterator __h, key_type&& __k, _Args&&... __args) { - _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i()_VSTD::addressof(__h) == this, + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__h) == this, "unordered_map::try_emplace(const_iterator, key, args...) called with an iterator not" " referring to this unordered_map"); ((void)__h); @@ -1693,7 +1692,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map( { _VSTD::__debug_db_insert_c(this); #if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->swap(this, _VSTD::addressof(__u)); + __get_db()->swap(this, &__u); #endif } @@ -1713,7 +1712,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map( } #if _LIBCPP_DEBUG_LEVEL == 2 else - __get_db()->swap(this, _VSTD::addressof(__u)); + __get_db()->swap(this, &__u); #endif } @@ -2469,7 +2468,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap( { _VSTD::__debug_db_insert_c(this); #if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->swap(this, _VSTD::addressof(__u)); + __get_db()->swap(this, &__u); #endif } @@ -2490,7 +2489,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap( } #if _LIBCPP_DEBUG_LEVEL == 2 else - __get_db()->swap(this, _VSTD::addressof(__u)); + __get_db()->swap(this, &__u); #endif } diff --git a/libcxx/test/std/containers/unord/unord.map/iterator.operators.addressof.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.map/iterator.operators.addressof.compile.pass.cpp deleted file mode 100644 index 856b78293a1077..00000000000000 --- a/libcxx/test/std/containers/unord/unord.map/iterator.operators.addressof.compile.pass.cpp +++ /dev/null @@ -1,49 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// - -// template , class Pred = equal_to, -// class Alloc = allocator>> -// class unordered_map - -// Validate the constructors of the (const)(_local)_iterator classes to be -// properly guarded against ADL-hijacking operator&. - -#include - -#include "test_macros.h" -#include "operator_hijacker.h" - -template -void test() { - FromIterator from; - ToIterator copy(from); - copy = from; - - ToIterator move(std::move(from)); - from = FromIterator(); - move = std::move(from); -} - -void test() { - { - using I = std::unordered_map::iterator; - using CI = std::unordered_map::const_iterator; - test(); - test(); - test(); - } - { - using IL = std::unordered_map::local_iterator; - using CIL = std::unordered_map::const_local_iterator; - test(); - test(); - test(); - } -} diff --git a/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/assign_move.addressof.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/assign_move.addressof.compile.pass.cpp deleted file mode 100644 index 6dbd7aaea2a8e8..00000000000000 --- a/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/assign_move.addressof.compile.pass.cpp +++ /dev/null @@ -1,42 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++03 - -// - -// template , class Pred = equal_to, -// class Alloc = allocator>> -// class unordered_map - -// unordered_map& operator=(unordered_map&&) -// noexcept( -// allocator_type::propagate_on_container_move_assignment::value && -// is_nothrow_move_assignable::value && -// is_nothrow_move_assignable::value && -// is_nothrow_move_assignable::value); - -// Validate whether the container can be move-assigned with an ADL-hijacking operator& - -#include - -#include "test_macros.h" -#include "operator_hijacker.h" - -void test() { - { - std::unordered_map mo; - std::unordered_map m; - m = std::move(mo); - } - { - std::unordered_map mo; - std::unordered_map m; - m = std::move(mo); - } -} diff --git a/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/move.addressof.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/move.addressof.compile.pass.cpp deleted file mode 100644 index e36c6525d631b3..00000000000000 --- a/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/move.addressof.compile.pass.cpp +++ /dev/null @@ -1,33 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++03 - -// - -// template , class Pred = equal_to, -// class Alloc = allocator>> -// class unordered_map - -// unordered_map(unordered_map&& u) -// noexcept( -// is_nothrow_move_constructible::value && -// is_nothrow_move_constructible::value && -// is_nothrow_move_constructible::value); - -// Validate whether the operation properly guards against ADL-hijacking operator& - -#include - -#include "test_macros.h" -#include "operator_hijacker.h" - -void test() { - std::unordered_map mo; - std::unordered_map m(std::move(mo)); -} diff --git a/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/move_alloc.addressof.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/move_alloc.addressof.compile.pass.cpp deleted file mode 100644 index 1fec0ee5d0f4b7..00000000000000 --- a/libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/move_alloc.addressof.compile.pass.cpp +++ /dev/null @@ -1,36 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++03 - -// - -// template , class Pred = equal_to, -// class Alloc = allocator>> -// class unordered_map - -// unordered_map(unordered_map&& u, const allocator_type& a); - -// Validate whether the operation properly guards against ADL-hijacking operator& - -#include - -#include "test_macros.h" -#include "operator_hijacker.h" - -#include "test_allocator.h" -#include "min_allocator.h" - -void test() { - using A = test_allocator>; - using C = std::unordered_map, - std::equal_to, A>; - - C mo; - C m(std::move(mo), A()); -} diff --git a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/emplace_hint.addressof.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/emplace_hint.addressof.compile.pass.cpp deleted file mode 100644 index 58ddefd8cfbfc1..00000000000000 --- a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/emplace_hint.addressof.compile.pass.cpp +++ /dev/null @@ -1,30 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++03 - -// - -// template , class Pred = equal_to, -// class Alloc = allocator>> -// class unordered_map - -// template -// iterator emplace_hint(const_iterator position, Args&&... args); - -// Validate whether the operation properly guards against ADL-hijacking operator& - -#include - -#include "test_macros.h" -#include "operator_hijacker.h" - -void test() { - std::unordered_map m; - m.emplace_hint(m.cbegin()); -} diff --git a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/erase_const_iter.addressof.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/erase_const_iter.addressof.compile.pass.cpp deleted file mode 100644 index 1461f2499baad6..00000000000000 --- a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/erase_const_iter.addressof.compile.pass.cpp +++ /dev/null @@ -1,27 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// - -// template , class Pred = equal_to, -// class Alloc = allocator>> -// class unordered_map - -// iterator erase(const_iterator p) - -// Validate whether the operation properly guards against ADL-hijacking operator& - -#include - -#include "test_macros.h" -#include "operator_hijacker.h" - -void test() { - std::unordered_map m; - m.erase(m.cbegin()); -} diff --git a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/erase_range.addressof.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/erase_range.addressof.compile.pass.cpp deleted file mode 100644 index 5f342f7b2152f0..00000000000000 --- a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/erase_range.addressof.compile.pass.cpp +++ /dev/null @@ -1,27 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// - -// template , class Pred = equal_to, -// class Alloc = allocator>> -// class unordered_map - -// iterator erase(const_iterator first, const_iterator last) - -// Validate whether the operation properly guards against ADL-hijacking operator& - -#include - -#include "test_macros.h" -#include "operator_hijacker.h" - -void test() { - std::unordered_map m; - m.erase(m.cbegin(), m.cend()); -} diff --git a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_const_lvalue.addressof.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_const_lvalue.addressof.compile.pass.cpp deleted file mode 100644 index db1805e7d7e63d..00000000000000 --- a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_hint_const_lvalue.addressof.compile.pass.cpp +++ /dev/null @@ -1,28 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// - -// template , class Pred = equal_to, -// class Alloc = allocator>> -// class unordered_map - -// iterator insert(const_iterator p, const value_type& x); - -// Validate whether the operation properly guards against ADL-hijacking operator& - -#include - -#include "test_macros.h" -#include "operator_hijacker.h" - -void test() { - std::unordered_map m; - const std::pair v; - m.insert(m.cend(), v); -} diff --git a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_rvalue_constructible_value_type.addressof.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_rvalue_constructible_value_type.addressof.compile.pass.cpp deleted file mode 100644 index 530b826b61e78a..00000000000000 --- a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_rvalue_constructible_value_type.addressof.compile.pass.cpp +++ /dev/null @@ -1,28 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++03 - -// - -// template , class Pred = equal_to, -// class Alloc = allocator>> -// class unordered_map - -// template ::value>::type> -// pair insert(P&& x); - -// Validate whether the operation properly guards against ADL-hijacking operator& - -#include - -#include "test_macros.h" -#include "operator_hijacker.h" - -void test(std::unordered_map& m) { m.insert(m.cend(), *m.begin()); } diff --git a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_rvalue_value_type.addressof.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_rvalue_value_type.addressof.compile.pass.cpp deleted file mode 100644 index 80219cb193edd3..00000000000000 --- a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_rvalue_value_type.addressof.compile.pass.cpp +++ /dev/null @@ -1,28 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++03 - -// - -// template , class Pred = equal_to, -// class Alloc = allocator>> -// class unordered_map - -// iterator insert(const_iterator hint, value_type&& obj); - -// Validate whether the operation properly guards against ADL-hijacking operator& - -#include - -#include "test_macros.h" -#include "operator_hijacker.h" - -void test(std::unordered_map& m) { - m.insert(m.cend(), std::pair{}); -} diff --git a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/try_emplace_hint.addressof.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/try_emplace_hint.addressof.compile.pass.cpp deleted file mode 100644 index 2c667374d4fe8e..00000000000000 --- a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/try_emplace_hint.addressof.compile.pass.cpp +++ /dev/null @@ -1,40 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++03, c++11, c++14 - -// - -// template , class Pred = equal_to, -// class Alloc = allocator>> -// class unordered_map - -// template -// iterator try_emplace(const_iterator hint, const key_type& k, Args&&... args); -// template -// iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args); -// template - -// Validate whether the operation properly guards against ADL-hijacking operator& - -#include - -#include "test_macros.h" -#include "operator_hijacker.h" - -void test() { - std::unordered_map m; - { - const operator_hijacker k; - m.try_emplace(m.cend(), k); - } - { - operator_hijacker k; - m.try_emplace(m.cend(), std::move(k)); - } -} diff --git a/libcxx/test/std/containers/unord/unord.map/unord.map.swap/swap.addressof.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.swap/swap.addressof.compile.pass.cpp deleted file mode 100644 index f5b5f516d42b58..00000000000000 --- a/libcxx/test/std/containers/unord/unord.map/unord.map.swap/swap.addressof.compile.pass.cpp +++ /dev/null @@ -1,29 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++03 - -// - -// void swap(unordered_map& c) -// noexcept(allocator_traits::is_always_equal::value && -// noexcept(swap(declval(), declval())) && -// noexcept(swap(declval(), declval()))); - -// Validate whether the operation properly guards against ADL-hijacking operator& - -#include - -#include "test_macros.h" -#include "operator_hijacker.h" - -void test() { - std::unordered_map m1; - std::unordered_map m2; - std::swap(m1, m2); -} diff --git a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move.addressof.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move.addressof.compile.pass.cpp deleted file mode 100644 index 73b19f35e20488..00000000000000 --- a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move.addressof.compile.pass.cpp +++ /dev/null @@ -1,33 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++03 - -// - -// template , class Pred = equal_to, -// class Alloc = allocator>> -// class unordered_multimap - -// unordered_multimap(unordered_multimap&&) -// noexcept( -// is_nothrow_move_constructible::value && -// is_nothrow_move_constructible::value && -// is_nothrow_move_constructible::value); - -// Validate whether the operation properly guards against ADL-hijacking operator& - -#include - -#include "test_macros.h" -#include "operator_hijacker.h" - -void test() { - std::unordered_multimap mo; - std::unordered_multimap m(std::move(mo)); -} diff --git a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_alloc.addressof.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_alloc.addressof.compile.pass.cpp deleted file mode 100644 index 6419a03666d656..00000000000000 --- a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_alloc.addressof.compile.pass.cpp +++ /dev/null @@ -1,36 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++03 - -// - -// template , class Pred = equal_to, -// class Alloc = allocator>> -// class unordered_multimap - -// unordered_multimap(unordered_map&& u, const allocator_type& a); - -// Validate whether the operation properly guards against ADL-hijacking operator& - -#include - -#include "test_macros.h" -#include "operator_hijacker.h" - -#include "test_allocator.h" -#include "min_allocator.h" - -void test() { - using A = test_allocator>; - using C = std::unordered_multimap, - std::equal_to, A>; - - C mo; - C m(std::move(mo), A()); -} diff --git a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace_hint.addressof.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace_hint.addressof.compile.pass.cpp deleted file mode 100644 index 5e23b73cf34b35..00000000000000 --- a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace_hint.addressof.compile.pass.cpp +++ /dev/null @@ -1,30 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++03 - -// - -// template , class Pred = equal_to, -// class Alloc = allocator>> -// class unordered_multimap - -// template -// iterator emplace_hint(const_iterator position, Args&&... args); - -// Validate whether the operation properly guards against ADL-hijacking operator& - -#include - -#include "test_macros.h" -#include "operator_hijacker.h" - -void test() { - std::unordered_multimap m; - m.emplace_hint(m.cbegin()); -}