diff options
Diffstat (limited to 'test/std/containers/unord')
38 files changed, 119 insertions, 105 deletions
diff --git a/test/std/containers/unord/unord.map/compare.pass.cpp b/test/std/containers/unord/unord.map/compare.pass.cpp index ea6d02f5f..cffc1dbd4 100644 --- a/test/std/containers/unord/unord.map/compare.pass.cpp +++ b/test/std/containers/unord/unord.map/compare.pass.cpp @@ -13,8 +13,8 @@ // class Alloc = allocator<pair<const Key, T>>> // class unordered_map -// http://llvm.org/bugs/show_bug.cgi?id=16538 -// http://llvm.org/bugs/show_bug.cgi?id=16549 +// https://bugs.llvm.org/show_bug.cgi?id=16538 +// https://bugs.llvm.org/show_bug.cgi?id=16549 #include <unordered_map> #include <cassert> diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/default_noexcept.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/default_noexcept.pass.cpp index 939e0bcd4..7ef7f47ff 100644 --- a/test/std/containers/unord/unord.map/unord.map.cnstr/default_noexcept.pass.cpp +++ b/test/std/containers/unord/unord.map/unord.map.cnstr/default_noexcept.pass.cpp @@ -42,19 +42,23 @@ struct some_hash typedef T value_type; some_hash(); some_hash(const some_hash&); + + std::size_t operator()(T const&) const; }; int main() { +#if defined(_LIBCPP_VERSION) { typedef std::unordered_map<MoveOnly, MoveOnly> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, ""); + static_assert(std::is_nothrow_default_constructible<C>::value, ""); } { typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, test_allocator<std::pair<const MoveOnly, MoveOnly>>> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, ""); + static_assert(std::is_nothrow_default_constructible<C>::value, ""); } +#endif // _LIBCPP_VERSION { typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, other_allocator<std::pair<const MoveOnly, MoveOnly>>> C; diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/dtor_noexcept.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/dtor_noexcept.pass.cpp index 4fb10afd4..0fe98abe7 100644 --- a/test/std/containers/unord/unord.map/unord.map.cnstr/dtor_noexcept.pass.cpp +++ b/test/std/containers/unord/unord.map/unord.map.cnstr/dtor_noexcept.pass.cpp @@ -35,6 +35,8 @@ struct some_hash some_hash(); some_hash(const some_hash&); ~some_hash() noexcept(false); + + std::size_t operator()(T const&) const; }; int main() @@ -53,13 +55,15 @@ int main() std::equal_to<MoveOnly>, other_allocator<std::pair<const MoveOnly, MoveOnly>>> C; static_assert(std::is_nothrow_destructible<C>::value, ""); } +#if defined(_LIBCPP_VERSION) { typedef std::unordered_map<MoveOnly, MoveOnly, some_hash<MoveOnly>> C; - LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, ""); + static_assert(!std::is_nothrow_destructible<C>::value, ""); } { typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>, some_comp<MoveOnly>> C; - LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, ""); + static_assert(!std::is_nothrow_destructible<C>::value, ""); } +#endif // _LIBCPP_VERSION } diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/move_assign_noexcept.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/move_assign_noexcept.pass.cpp index c0dc71da4..4191102a8 100644 --- a/test/std/containers/unord/unord.map/unord.map.cnstr/move_assign_noexcept.pass.cpp +++ b/test/std/containers/unord/unord.map/unord.map.cnstr/move_assign_noexcept.pass.cpp @@ -41,6 +41,8 @@ struct some_hash some_hash(); some_hash(const some_hash&); some_hash& operator=(const some_hash&); + + std::size_t operator()(T const&) const; }; int main() @@ -54,11 +56,13 @@ int main() std::equal_to<MoveOnly>, test_allocator<std::pair<const MoveOnly, MoveOnly>>> C; static_assert(!std::is_nothrow_move_assignable<C>::value, ""); } +#if defined(_LIBCPP_VERSION) { typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, other_allocator<std::pair<const MoveOnly, MoveOnly>>> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, ""); + static_assert(std::is_nothrow_move_assignable<C>::value, ""); } +#endif // _LIBCPP_VERSION { typedef std::unordered_map<MoveOnly, MoveOnly, some_hash<MoveOnly>> C; static_assert(!std::is_nothrow_move_assignable<C>::value, ""); diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/move_noexcept.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/move_noexcept.pass.cpp index c40173ede..2eb8c9467 100644 --- a/test/std/containers/unord/unord.map/unord.map.cnstr/move_noexcept.pass.cpp +++ b/test/std/containers/unord/unord.map/unord.map.cnstr/move_noexcept.pass.cpp @@ -38,24 +38,28 @@ struct some_hash typedef T value_type; some_hash(); some_hash(const some_hash&); + + std::size_t operator()(T const&) const; }; int main() { +#if defined(_LIBCPP_VERSION) { typedef std::unordered_map<MoveOnly, MoveOnly> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, ""); + static_assert(std::is_nothrow_move_constructible<C>::value, ""); } { typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, test_allocator<std::pair<const MoveOnly, MoveOnly>>> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, ""); + static_assert(std::is_nothrow_move_constructible<C>::value, ""); } { typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, other_allocator<std::pair<const MoveOnly, MoveOnly>>> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, ""); + static_assert(std::is_nothrow_move_constructible<C>::value, ""); } +#endif // _LIBCPP_VERSION { typedef std::unordered_map<MoveOnly, MoveOnly, some_hash<MoveOnly>> C; static_assert(!std::is_nothrow_move_constructible<C>::value, ""); diff --git a/test/std/containers/unord/unord.map/unord.map.elem/index_tuple.pass.cpp b/test/std/containers/unord/unord.map/unord.map.elem/index_tuple.pass.cpp index f2c694e86..400e0283f 100644 --- a/test/std/containers/unord/unord.map/unord.map.elem/index_tuple.pass.cpp +++ b/test/std/containers/unord/unord.map/unord.map.elem/index_tuple.pass.cpp @@ -17,7 +17,7 @@ // mapped_type& operator[](const key_type& k); -// http://llvm.org/bugs/show_bug.cgi?id=16542 +// https://bugs.llvm.org/show_bug.cgi?id=16542 #include <unordered_map> #include <tuple> diff --git a/test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp b/test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp index fc286ceec..75807fa78 100644 --- a/test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp +++ b/test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp @@ -64,6 +64,7 @@ struct some_hash typedef T value_type; some_hash() {} some_hash(const some_hash&); + std::size_t operator()(T const&) const; }; template <class T> @@ -72,6 +73,7 @@ struct some_hash2 typedef T value_type; some_hash2() {} some_hash2(const some_hash2&); + std::size_t operator()(T const&) const; }; #if TEST_STD_VER >= 14 @@ -125,16 +127,18 @@ int main() typedef std::unordered_map<MoveOnly, MoveOnly> C; static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); } +#if defined(_LIBCPP_VERSION) { typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, test_allocator<MapType>> C; - LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); + static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); } { typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, other_allocator<MapType>> C; - LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); + static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); } +#endif // _LIBCPP_VERSION { typedef std::unordered_map<MoveOnly, MoveOnly, some_hash<MoveOnly>> C; static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); @@ -178,10 +182,11 @@ int main() typedef std::unordered_map<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc2<MapType>> C; static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); } - +#if defined(_LIBCPP_VERSION) { // NOT always equal allocator, nothrow swap for hash, nothrow swap for comp typedef std::unordered_map<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc3<MapType>> C; - LIBCPP_STATIC_ASSERT( noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); + static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); } +#endif // _LIBCPP_VERSION #endif } diff --git a/test/std/containers/unord/unord.multimap/bucket_count.pass.cpp b/test/std/containers/unord/unord.multimap/bucket_count.pass.cpp index 4eea3d0f6..5cb60f6a6 100644 --- a/test/std/containers/unord/unord.multimap/bucket_count.pass.cpp +++ b/test/std/containers/unord/unord.multimap/bucket_count.pass.cpp @@ -25,14 +25,11 @@ int main() { { typedef std::unordered_multimap<int, std::string> C; - typedef C::const_iterator I; - typedef std::pair<int, std::string> P; const C c; LIBCPP_ASSERT(c.bucket_count() == 0); } { typedef std::unordered_multimap<int, std::string> C; - typedef C::const_iterator I; typedef std::pair<int, std::string> P; P a[] = { diff --git a/test/std/containers/unord/unord.multimap/load_factor.pass.cpp b/test/std/containers/unord/unord.multimap/load_factor.pass.cpp index 9c4243594..ff3bc0105 100644 --- a/test/std/containers/unord/unord.multimap/load_factor.pass.cpp +++ b/test/std/containers/unord/unord.multimap/load_factor.pass.cpp @@ -44,7 +44,6 @@ int main() } { typedef std::unordered_multimap<int, std::string> C; - typedef std::pair<int, std::string> P; const C c; assert(c.load_factor() == 0); } @@ -70,7 +69,6 @@ int main() { typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>, min_allocator<std::pair<const int, std::string>>> C; - typedef std::pair<int, std::string> P; const C c; assert(c.load_factor() == 0); } diff --git a/test/std/containers/unord/unord.multimap/max_bucket_count.pass.cpp b/test/std/containers/unord/unord.multimap/max_bucket_count.pass.cpp index a2ab399d3..3e9a10ab7 100644 --- a/test/std/containers/unord/unord.multimap/max_bucket_count.pass.cpp +++ b/test/std/containers/unord/unord.multimap/max_bucket_count.pass.cpp @@ -25,8 +25,6 @@ int main() { { typedef std::unordered_multimap<int, std::string> C; - typedef C::const_iterator I; - typedef std::pair<int, std::string> P; const C c; assert(c.max_bucket_count() > 0); } @@ -34,8 +32,6 @@ int main() { typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>, min_allocator<std::pair<const int, std::string>>> C; - typedef C::const_iterator I; - typedef std::pair<int, std::string> P; const C c; assert(c.max_bucket_count() > 0); } diff --git a/test/std/containers/unord/unord.multimap/max_load_factor.pass.cpp b/test/std/containers/unord/unord.multimap/max_load_factor.pass.cpp index b0b2b664f..38c8285f5 100644 --- a/test/std/containers/unord/unord.multimap/max_load_factor.pass.cpp +++ b/test/std/containers/unord/unord.multimap/max_load_factor.pass.cpp @@ -30,13 +30,11 @@ int main() { { typedef std::unordered_multimap<int, std::string> C; - typedef std::pair<int, std::string> P; const C c; assert(c.max_load_factor() == 1); } { typedef std::unordered_multimap<int, std::string> C; - typedef std::pair<int, std::string> P; C c; assert(c.max_load_factor() == 1); c.max_load_factor(2.5); @@ -46,14 +44,12 @@ int main() { typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>, min_allocator<std::pair<const int, std::string>>> C; - typedef std::pair<int, std::string> P; const C c; assert(c.max_load_factor() == 1); } { typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>, min_allocator<std::pair<const int, std::string>>> C; - typedef std::pair<int, std::string> P; C c; assert(c.max_load_factor() == 1); c.max_load_factor(2.5); diff --git a/test/std/containers/unord/unord.multimap/swap_member.pass.cpp b/test/std/containers/unord/unord.multimap/swap_member.pass.cpp index 0f898f1b7..8c5ddab05 100644 --- a/test/std/containers/unord/unord.multimap/swap_member.pass.cpp +++ b/test/std/containers/unord/unord.multimap/swap_member.pass.cpp @@ -34,7 +34,6 @@ int main() typedef test_compare<std::equal_to<int> > Compare; typedef test_allocator<std::pair<const int, std::string> > Alloc; typedef std::unordered_multimap<int, std::string, Hash, Compare, Alloc> C; - typedef std::pair<int, std::string> P; C c1(0, Hash(1), Compare(1), Alloc(1, 1)); C c2(0, Hash(2), Compare(2), Alloc(1, 2)); c2.max_load_factor(2); @@ -219,7 +218,6 @@ int main() typedef test_compare<std::equal_to<int> > Compare; typedef other_allocator<std::pair<const int, std::string> > Alloc; typedef std::unordered_multimap<int, std::string, Hash, Compare, Alloc> C; - typedef std::pair<int, std::string> P; C c1(0, Hash(1), Compare(1), Alloc(1)); C c2(0, Hash(2), Compare(2), Alloc(2)); c2.max_load_factor(2); @@ -404,7 +402,6 @@ int main() typedef test_compare<std::equal_to<int> > Compare; typedef min_allocator<std::pair<const int, std::string> > Alloc; typedef std::unordered_multimap<int, std::string, Hash, Compare, Alloc> C; - typedef std::pair<int, std::string> P; C c1(0, Hash(1), Compare(1), Alloc()); C c2(0, Hash(2), Compare(2), Alloc()); c2.max_load_factor(2); diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/default_noexcept.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/default_noexcept.pass.cpp index e404612a7..d924ef15c 100644 --- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/default_noexcept.pass.cpp +++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/default_noexcept.pass.cpp @@ -42,19 +42,22 @@ struct some_hash typedef T value_type; some_hash(); some_hash(const some_hash&); + std::size_t operator()(T const&) const; }; int main() { +#if defined(_LIBCPP_VERSION) { typedef std::unordered_multimap<MoveOnly, MoveOnly> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, ""); + static_assert(std::is_nothrow_default_constructible<C>::value, ""); } { typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, test_allocator<std::pair<const MoveOnly, MoveOnly>>> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, ""); + static_assert(std::is_nothrow_default_constructible<C>::value, ""); } +#endif // _LIBCPP_VERSION { typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, other_allocator<std::pair<const MoveOnly, MoveOnly>>> C; diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/dtor_noexcept.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/dtor_noexcept.pass.cpp index b5f440317..2fbe7a674 100644 --- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/dtor_noexcept.pass.cpp +++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/dtor_noexcept.pass.cpp @@ -35,6 +35,7 @@ struct some_hash some_hash(); some_hash(const some_hash&); ~some_hash() noexcept(false); + std::size_t operator()(T const&) const; }; int main() @@ -53,13 +54,15 @@ int main() std::equal_to<MoveOnly>, other_allocator<std::pair<const MoveOnly, MoveOnly>>> C; static_assert(std::is_nothrow_destructible<C>::value, ""); } +#if defined(_LIBCPP_VERSION) { typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>> C; - LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, ""); + static_assert(!std::is_nothrow_destructible<C>::value, ""); } { typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>, some_comp<MoveOnly>> C; - LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, ""); + static_assert(!std::is_nothrow_destructible<C>::value, ""); } +#endif // _LIBCPP_VERSION } diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_assign_noexcept.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_assign_noexcept.pass.cpp index b621449f2..2d5766946 100644 --- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_assign_noexcept.pass.cpp +++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_assign_noexcept.pass.cpp @@ -41,6 +41,7 @@ struct some_hash some_hash(); some_hash(const some_hash&); some_hash& operator=(const some_hash&); + std::size_t operator()(T const&) const; }; int main() @@ -54,11 +55,13 @@ int main() std::equal_to<MoveOnly>, test_allocator<std::pair<const MoveOnly, MoveOnly>>> C; static_assert(!std::is_nothrow_move_assignable<C>::value, ""); } +#if defined(_LIBCPP_VERSION) { typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, other_allocator<std::pair<const MoveOnly, MoveOnly>>> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, ""); + static_assert(std::is_nothrow_move_assignable<C>::value, ""); } +#endif // _LIBCPP_VERSION { typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>> C; static_assert(!std::is_nothrow_move_assignable<C>::value, ""); diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_noexcept.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_noexcept.pass.cpp index 94067c316..7f3a337bd 100644 --- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_noexcept.pass.cpp +++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_noexcept.pass.cpp @@ -38,24 +38,27 @@ struct some_hash typedef T value_type; some_hash(); some_hash(const some_hash&); + std::size_t operator()(T const&) const; }; int main() { +#if defined(_LIBCPP_VERSION) { typedef std::unordered_multimap<MoveOnly, MoveOnly> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, ""); + static_assert(std::is_nothrow_move_constructible<C>::value, ""); } { typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, test_allocator<std::pair<const MoveOnly, MoveOnly>>> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, ""); + static_assert(std::is_nothrow_move_constructible<C>::value, ""); } { typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, other_allocator<std::pair<const MoveOnly, MoveOnly>>> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, ""); + static_assert(std::is_nothrow_move_constructible<C>::value, ""); } +#endif // _LIBCPP_VERSION { typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>> C; static_assert(!std::is_nothrow_move_constructible<C>::value, ""); diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp index 7a58709c9..33d8e3c36 100644 --- a/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp +++ b/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp @@ -64,6 +64,7 @@ struct some_hash typedef T value_type; some_hash() {} some_hash(const some_hash&); + std::size_t operator()(T const&) const; }; template <class T> @@ -72,6 +73,7 @@ struct some_hash2 typedef T value_type; some_hash2() {} some_hash2(const some_hash2&); + std::size_t operator()(T const&) const; }; #if TEST_STD_VER >= 14 @@ -124,16 +126,18 @@ int main() typedef std::unordered_multimap<MoveOnly, MoveOnly> C; static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); } +#if defined(_LIBCPP_VERSION) { typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, test_allocator<V>> C; - LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); + static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); } { typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, other_allocator<V>> C; - LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); + static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); } +#endif // _LIBCPP_VERSION { typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash<MoveOnly>> C; static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); @@ -177,9 +181,11 @@ int main() typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc2<V>> C; static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); } +#if defined(_LIBCPP_VERSION) { // NOT always equal allocator, nothrow swap for hash, nothrow swap for comp typedef std::unordered_multimap<MoveOnly, MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc3<V>> C; - LIBCPP_STATIC_ASSERT( noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); + static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); } +#endif // _LIBCPP_VERSION #endif } diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp index 06e6c65c9..644af867d 100644 --- a/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp +++ b/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp @@ -33,7 +33,6 @@ int main() typedef test_compare<std::equal_to<int> > Compare; typedef test_allocator<std::pair<const int, std::string> > Alloc; typedef std::unordered_multimap<int, std::string, Hash, Compare, Alloc> C; - typedef std::pair<int, std::string> P; C c1(0, Hash(1), Compare(1), Alloc(1, 1)); C c2(0, Hash(2), Compare(2), Alloc(1, 2)); c2.max_load_factor(2); @@ -218,7 +217,6 @@ int main() typedef test_compare<std::equal_to<int> > Compare; typedef other_allocator<std::pair<const int, std::string> > Alloc; typedef std::unordered_multimap<int, std::string, Hash, Compare, Alloc> C; - typedef std::pair<int, std::string> P; C c1(0, Hash(1), Compare(1), Alloc(1)); C c2(0, Hash(2), Compare(2), Alloc(2)); c2.max_load_factor(2); @@ -403,7 +401,6 @@ int main() typedef test_compare<std::equal_to<int> > Compare; typedef min_allocator<std::pair<const int, std::string> > Alloc; typedef std::unordered_multimap<int, std::string, Hash, Compare, Alloc> C; - typedef std::pair<int, std::string> P; C c1(0, Hash(1), Compare(1), Alloc()); C c2(0, Hash(2), Compare(2), Alloc()); c2.max_load_factor(2); diff --git a/test/std/containers/unord/unord.multiset/bucket_count.pass.cpp b/test/std/containers/unord/unord.multiset/bucket_count.pass.cpp index ec4d0e675..c60a81167 100644 --- a/test/std/containers/unord/unord.multiset/bucket_count.pass.cpp +++ b/test/std/containers/unord/unord.multiset/bucket_count.pass.cpp @@ -25,14 +25,11 @@ int main() { { typedef std::unordered_multiset<int> C; - typedef C::const_iterator I; - typedef int P; const C c; LIBCPP_ASSERT(c.bucket_count() == 0); } { typedef std::unordered_multiset<int> C; - typedef C::const_iterator I; typedef int P; P a[] = { @@ -52,15 +49,12 @@ int main() { typedef std::unordered_multiset<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C; - typedef C::const_iterator I; - typedef int P; const C c; LIBCPP_ASSERT(c.bucket_count() == 0); } { typedef std::unordered_multiset<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C; - typedef C::const_iterator I; typedef int P; P a[] = { diff --git a/test/std/containers/unord/unord.multiset/load_factor.pass.cpp b/test/std/containers/unord/unord.multiset/load_factor.pass.cpp index fad1c182e..df2cb7bef 100644 --- a/test/std/containers/unord/unord.multiset/load_factor.pass.cpp +++ b/test/std/containers/unord/unord.multiset/load_factor.pass.cpp @@ -43,7 +43,6 @@ int main() } { typedef std::unordered_multiset<int> C; - typedef int P; const C c; assert(c.load_factor() == 0); } @@ -69,7 +68,6 @@ int main() { typedef std::unordered_multiset<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C; - typedef int P; const C c; assert(c.load_factor() == 0); } diff --git a/test/std/containers/unord/unord.multiset/max_load_factor.pass.cpp b/test/std/containers/unord/unord.multiset/max_load_factor.pass.cpp index 00fe96232..f7ebaaf65 100644 --- a/test/std/containers/unord/unord.multiset/max_load_factor.pass.cpp +++ b/test/std/containers/unord/unord.multiset/max_load_factor.pass.cpp @@ -29,13 +29,11 @@ int main() { { typedef std::unordered_multiset<int> C; - typedef int P; const C c; assert(c.max_load_factor() == 1); } { typedef std::unordered_multiset<int> C; - typedef int P; C c; assert(c.max_load_factor() == 1); c.max_load_factor(2.5); @@ -45,14 +43,12 @@ int main() { typedef std::unordered_multiset<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C; - typedef int P; const C c; assert(c.max_load_factor() == 1); } { typedef std::unordered_multiset<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C; - typedef int P; C c; assert(c.max_load_factor() == 1); c.max_load_factor(2.5); diff --git a/test/std/containers/unord/unord.multiset/swap_member.pass.cpp b/test/std/containers/unord/unord.multiset/swap_member.pass.cpp index c0c9e9021..9ffe3ad48 100644 --- a/test/std/containers/unord/unord.multiset/swap_member.pass.cpp +++ b/test/std/containers/unord/unord.multiset/swap_member.pass.cpp @@ -32,7 +32,6 @@ int main() typedef test_compare<std::equal_to<int> > Compare; typedef test_allocator<int> Alloc; typedef std::unordered_multiset<int, Hash, Compare, Alloc> C; - typedef int P; C c1(0, Hash(1), Compare(1), Alloc(1, 1)); C c2(0, Hash(2), Compare(2), Alloc(1, 2)); c2.max_load_factor(2); @@ -213,7 +212,6 @@ int main() typedef test_compare<std::equal_to<int> > Compare; typedef other_allocator<int> Alloc; typedef std::unordered_multiset<int, Hash, Compare, Alloc> C; - typedef int P; C c1(0, Hash(1), Compare(1), Alloc(1)); C c2(0, Hash(2), Compare(2), Alloc(2)); c2.max_load_factor(2); @@ -394,7 +392,6 @@ int main() typedef test_compare<std::equal_to<int> > Compare; typedef min_allocator<int> Alloc; typedef std::unordered_multiset<int, Hash, Compare, Alloc> C; - typedef int P; C c1(0, Hash(1), Compare(1), Alloc()); C c2(0, Hash(2), Compare(2), Alloc()); c2.max_load_factor(2); diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default_noexcept.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default_noexcept.pass.cpp index fba024aed..3b69c1eed 100644 --- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default_noexcept.pass.cpp +++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default_noexcept.pass.cpp @@ -42,19 +42,22 @@ struct some_hash typedef T value_type; some_hash(); some_hash(const some_hash&); + std::size_t operator()(T const&) const; }; int main() { +#if defined(_LIBCPP_VERSION) { typedef std::unordered_multiset<MoveOnly> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, ""); + static_assert(std::is_nothrow_default_constructible<C>::value, ""); } { typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, ""); + static_assert(std::is_nothrow_default_constructible<C>::value, ""); } +#endif // _LIBCPP_VERSION { typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C; diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/dtor_noexcept.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/dtor_noexcept.pass.cpp index 62fe51e29..1e927b9b3 100644 --- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/dtor_noexcept.pass.cpp +++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/dtor_noexcept.pass.cpp @@ -35,6 +35,7 @@ struct some_hash some_hash(); some_hash(const some_hash&); ~some_hash() noexcept(false); + std::size_t operator()(T const&) const; }; int main() @@ -53,13 +54,15 @@ int main() std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C; static_assert(std::is_nothrow_destructible<C>::value, ""); } +#if defined(_LIBCPP_VERSION) { typedef std::unordered_multiset<MoveOnly, some_hash<MoveOnly>> C; - LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, ""); + static_assert(!std::is_nothrow_destructible<C>::value, ""); } { typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>, some_comp<MoveOnly>> C; - LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, ""); + static_assert(!std::is_nothrow_destructible<C>::value, ""); } +#endif // _LIBCPP_VERSION } diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_assign_noexcept.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_assign_noexcept.pass.cpp index ac0a10a4b..7336bb5af 100644 --- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_assign_noexcept.pass.cpp +++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_assign_noexcept.pass.cpp @@ -41,6 +41,7 @@ struct some_hash some_hash(); some_hash(const some_hash&); some_hash& operator=(const some_hash&); + std::size_t operator()(T const&) const; }; int main() @@ -54,11 +55,13 @@ int main() std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C; static_assert(!std::is_nothrow_move_assignable<C>::value, ""); } +#if defined(_LIBCPP_VERSION) { typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, ""); + static_assert(std::is_nothrow_move_assignable<C>::value, ""); } +#endif // _LIBCPP_VERSION { typedef std::unordered_multiset<MoveOnly, some_hash<MoveOnly>> C; static_assert(!std::is_nothrow_move_assignable<C>::value, ""); diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_noexcept.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_noexcept.pass.cpp index e44be18fa..fcf2a5af3 100644 --- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_noexcept.pass.cpp +++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_noexcept.pass.cpp @@ -38,24 +38,27 @@ struct some_hash typedef T value_type; some_hash(); some_hash(const some_hash&); + std::size_t operator()(T const&) const; }; int main() { +#if defined(_LIBCPP_VERSION) { typedef std::unordered_multiset<MoveOnly> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, ""); + static_assert(std::is_nothrow_move_constructible<C>::value, ""); } { typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, ""); + static_assert(std::is_nothrow_move_constructible<C>::value, ""); } { typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, ""); + static_assert(std::is_nothrow_move_constructible<C>::value, ""); } +#endif // _LIBCPP_VERSION { typedef std::unordered_multiset<MoveOnly, some_hash<MoveOnly>> C; static_assert(!std::is_nothrow_move_constructible<C>::value, ""); diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_noexcept.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_noexcept.pass.cpp index c221b6f2e..4afef42e6 100644 --- a/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_noexcept.pass.cpp +++ b/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_noexcept.pass.cpp @@ -125,16 +125,18 @@ int main() typedef std::unordered_multiset<MoveOnly> C; static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); } +#if defined(_LIBCPP_VERSION) { typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C; - LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); + static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); } { typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C; - LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); + static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); } +#endif // _LIBCPP_VERSION { typedef std::unordered_multiset<MoveOnly, some_hash<MoveOnly>> C; static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); @@ -178,10 +180,11 @@ int main() typedef std::unordered_multiset<MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc2<MoveOnly>> C; static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); } - +#if defined(_LIBCPP_VERSION) { // NOT always equal allocator, nothrow swap for hash, nothrow swap for comp typedef std::unordered_multiset<MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc3<MoveOnly>> C; - LIBCPP_STATIC_ASSERT( noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); + static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); } +#endif // _LIBCPP_VERSION #endif } diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_non_member.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_non_member.pass.cpp index d4efb6868..ce290ff1c 100644 --- a/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_non_member.pass.cpp +++ b/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_non_member.pass.cpp @@ -32,7 +32,6 @@ int main() typedef test_compare<std::equal_to<int> > Compare; typedef test_allocator<int> Alloc; typedef std::unordered_multiset<int, Hash, Compare, Alloc> C; - typedef int P; C c1(0, Hash(1), Compare(1), Alloc(1, 1)); C c2(0, Hash(2), Compare(2), Alloc(1, 2)); c2.max_load_factor(2); @@ -213,7 +212,6 @@ int main() typedef test_compare<std::equal_to<int> > Compare; typedef other_allocator<int> Alloc; typedef std::unordered_multiset<int, Hash, Compare, Alloc> C; - typedef int P; C c1(0, Hash(1), Compare(1), Alloc(1)); C c2(0, Hash(2), Compare(2), Alloc(2)); c2.max_load_factor(2); @@ -394,7 +392,6 @@ int main() typedef test_compare<std::equal_to<int> > Compare; typedef min_allocator<int> Alloc; typedef std::unordered_multiset<int, Hash, Compare, Alloc> C; - typedef int P; C c1(0, Hash(1), Compare(1), Alloc()); C c2(0, Hash(2), Compare(2), Alloc()); c2.max_load_factor(2); diff --git a/test/std/containers/unord/unord.set/bucket_count.pass.cpp b/test/std/containers/unord/unord.set/bucket_count.pass.cpp index 6f1f526ab..227d9e123 100644 --- a/test/std/containers/unord/unord.set/bucket_count.pass.cpp +++ b/test/std/containers/unord/unord.set/bucket_count.pass.cpp @@ -25,14 +25,11 @@ int main() { { typedef std::unordered_set<int> C; - typedef C::const_iterator I; - typedef int P; const C c; LIBCPP_ASSERT(c.bucket_count() == 0); } { typedef std::unordered_set<int> C; - typedef C::const_iterator I; typedef int P; P a[] = { @@ -51,14 +48,11 @@ int main() #if TEST_STD_VER >= 11 { typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C; - typedef C::const_iterator I; - typedef int P; const C c; LIBCPP_ASSERT(c.bucket_count() == 0); } { typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C; - typedef C::const_iterator I; typedef int P; P a[] = { diff --git a/test/std/containers/unord/unord.set/load_factor.pass.cpp b/test/std/containers/unord/unord.set/load_factor.pass.cpp index a342d472a..94eb5d1bd 100644 --- a/test/std/containers/unord/unord.set/load_factor.pass.cpp +++ b/test/std/containers/unord/unord.set/load_factor.pass.cpp @@ -43,7 +43,6 @@ int main() } { typedef std::unordered_set<int> C; - typedef int P; const C c; assert(c.load_factor() == 0); } @@ -69,7 +68,6 @@ int main() { typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C; - typedef int P; const C c; assert(c.load_factor() == 0); } diff --git a/test/std/containers/unord/unord.set/max_load_factor.pass.cpp b/test/std/containers/unord/unord.set/max_load_factor.pass.cpp index 542788cca..e9e04bca8 100644 --- a/test/std/containers/unord/unord.set/max_load_factor.pass.cpp +++ b/test/std/containers/unord/unord.set/max_load_factor.pass.cpp @@ -29,13 +29,11 @@ int main() { { typedef std::unordered_set<int> C; - typedef int P; const C c; assert(c.max_load_factor() == 1); } { typedef std::unordered_set<int> C; - typedef int P; C c; assert(c.max_load_factor() == 1); c.max_load_factor(2.5); @@ -45,14 +43,12 @@ int main() { typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C; - typedef int P; const C c; assert(c.max_load_factor() == 1); } { typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C; - typedef int P; C c; assert(c.max_load_factor() == 1); c.max_load_factor(2.5); diff --git a/test/std/containers/unord/unord.set/swap_member.pass.cpp b/test/std/containers/unord/unord.set/swap_member.pass.cpp index ea88c53a5..597662112 100644 --- a/test/std/containers/unord/unord.set/swap_member.pass.cpp +++ b/test/std/containers/unord/unord.set/swap_member.pass.cpp @@ -32,7 +32,6 @@ int main() typedef test_compare<std::equal_to<int> > Compare; typedef test_allocator<int> Alloc; typedef std::unordered_set<int, Hash, Compare, Alloc> C; - typedef int P; C c1(0, Hash(1), Compare(1), Alloc(1, 1)); C c2(0, Hash(2), Compare(2), Alloc(1, 2)); c2.max_load_factor(2); @@ -213,7 +212,6 @@ int main() typedef test_compare<std::equal_to<int> > Compare; typedef other_allocator<int> Alloc; typedef std::unordered_set<int, Hash, Compare, Alloc> C; - typedef int P; C c1(0, Hash(1), Compare(1), Alloc(1)); C c2(0, Hash(2), Compare(2), Alloc(2)); c2.max_load_factor(2); @@ -394,7 +392,6 @@ int main() typedef test_compare<std::equal_to<int> > Compare; typedef min_allocator<int> Alloc; typedef std::unordered_set<int, Hash, Compare, Alloc> C; - typedef int P; C c1(0, Hash(1), Compare(1), Alloc()); C c2(0, Hash(2), Compare(2), Alloc()); c2.max_load_factor(2); diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/default_noexcept.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/default_noexcept.pass.cpp index 3dcc32479..b8d06dbfd 100644 --- a/test/std/containers/unord/unord.set/unord.set.cnstr/default_noexcept.pass.cpp +++ b/test/std/containers/unord/unord.set/unord.set.cnstr/default_noexcept.pass.cpp @@ -42,19 +42,22 @@ struct some_hash typedef T value_type; some_hash(); some_hash(const some_hash&); + std::size_t operator()(T const&) const; }; int main() { +#if defined(_LIBCPP_VERSION) { typedef std::unordered_set<MoveOnly> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, ""); + static_assert(std::is_nothrow_default_constructible<C>::value, ""); } { typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, ""); + static_assert(std::is_nothrow_default_constructible<C>::value, ""); } +#endif // _LIBCPP_VERSION { typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C; diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/dtor_noexcept.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/dtor_noexcept.pass.cpp index 82e184b8d..4c10ed2d6 100644 --- a/test/std/containers/unord/unord.set/unord.set.cnstr/dtor_noexcept.pass.cpp +++ b/test/std/containers/unord/unord.set/unord.set.cnstr/dtor_noexcept.pass.cpp @@ -35,6 +35,7 @@ struct some_hash some_hash(); some_hash(const some_hash&); ~some_hash() noexcept(false); + std::size_t operator()(T const&) const; }; int main() @@ -53,13 +54,15 @@ int main() std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C; static_assert(std::is_nothrow_destructible<C>::value, ""); } +#if defined(_LIBCPP_VERSION) { typedef std::unordered_set<MoveOnly, some_hash<MoveOnly>> C; - LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, ""); + static_assert(!std::is_nothrow_destructible<C>::value, ""); } { typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>, some_comp<MoveOnly>> C; - LIBCPP_STATIC_ASSERT(!std::is_nothrow_destructible<C>::value, ""); + static_assert(!std::is_nothrow_destructible<C>::value, ""); } +#endif // _LIBCPP_VERSION } diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/move_assign_noexcept.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/move_assign_noexcept.pass.cpp index b89d68002..670a3484d 100644 --- a/test/std/containers/unord/unord.set/unord.set.cnstr/move_assign_noexcept.pass.cpp +++ b/test/std/containers/unord/unord.set/unord.set.cnstr/move_assign_noexcept.pass.cpp @@ -41,6 +41,7 @@ struct some_hash some_hash(); some_hash(const some_hash&); some_hash& operator=(const some_hash&); + std::size_t operator()(T const&) const; }; int main() @@ -54,11 +55,13 @@ int main() std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C; static_assert(!std::is_nothrow_move_assignable<C>::value, ""); } +#if defined(_LIBCPP_VERSION) { typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, ""); + static_assert(std::is_nothrow_move_assignable<C>::value, ""); } +#endif // _LIBCPP_VERSION { typedef std::unordered_set<MoveOnly, some_hash<MoveOnly>> C; static_assert(!std::is_nothrow_move_assignable<C>::value, ""); diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/move_noexcept.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/move_noexcept.pass.cpp index 7190a0120..43e06bd50 100644 --- a/test/std/containers/unord/unord.set/unord.set.cnstr/move_noexcept.pass.cpp +++ b/test/std/containers/unord/unord.set/unord.set.cnstr/move_noexcept.pass.cpp @@ -38,24 +38,27 @@ struct some_hash typedef T value_type; some_hash(); some_hash(const some_hash&); + std::size_t operator()(T const&) const; }; int main() { +#if defined(_LIBCPP_VERSION) { typedef std::unordered_set<MoveOnly> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, ""); + static_assert(std::is_nothrow_move_constructible<C>::value, ""); } { typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, ""); + static_assert(std::is_nothrow_move_constructible<C>::value, ""); } { typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C; - LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, ""); + static_assert(std::is_nothrow_move_constructible<C>::value, ""); } +#endif // _LIBCPP_VERSION { typedef std::unordered_set<MoveOnly, some_hash<MoveOnly>> C; static_assert(!std::is_nothrow_move_constructible<C>::value, ""); diff --git a/test/std/containers/unord/unord.set/unord.set.swap/swap_noexcept.pass.cpp b/test/std/containers/unord/unord.set/unord.set.swap/swap_noexcept.pass.cpp index 4a16ddd3f..7187f94a2 100644 --- a/test/std/containers/unord/unord.set/unord.set.swap/swap_noexcept.pass.cpp +++ b/test/std/containers/unord/unord.set/unord.set.swap/swap_noexcept.pass.cpp @@ -125,16 +125,18 @@ int main() typedef std::unordered_set<MoveOnly> C; static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); } +#if defined(_LIBCPP_VERSION) { typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C; - LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); + static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); } { typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, other_allocator<MoveOnly>> C; - LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); + static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); } +#endif // _LIBCPP_VERSION { typedef std::unordered_set<MoveOnly, some_hash<MoveOnly>> C; static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); @@ -178,10 +180,11 @@ int main() typedef std::unordered_set<MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc2<MoveOnly>> C; static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); } - +#if defined(_LIBCPP_VERSION) { // NOT always equal allocator, nothrow swap for hash, nothrow swap for comp typedef std::unordered_set<MoveOnly, some_hash2<MoveOnly>, some_comp2<MoveOnly>, some_alloc3<MoveOnly>> C; - LIBCPP_STATIC_ASSERT( noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); + static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), ""); } +#endif // _LIBCPP_VERSION #endif } diff --git a/test/std/containers/unord/unord.set/unord.set.swap/swap_non_member.pass.cpp b/test/std/containers/unord/unord.set/unord.set.swap/swap_non_member.pass.cpp index c2bd75960..9ca2f80f0 100644 --- a/test/std/containers/unord/unord.set/unord.set.swap/swap_non_member.pass.cpp +++ b/test/std/containers/unord/unord.set/unord.set.swap/swap_non_member.pass.cpp @@ -32,7 +32,6 @@ int main() typedef test_compare<std::equal_to<int> > Compare; typedef test_allocator<int> Alloc; typedef std::unordered_set<int, Hash, Compare, Alloc> C; - typedef int P; C c1(0, Hash(1), Compare(1), Alloc(1, 1)); C c2(0, Hash(2), Compare(2), Alloc(1, 2)); c2.max_load_factor(2); @@ -213,7 +212,6 @@ int main() typedef test_compare<std::equal_to<int> > Compare; typedef other_allocator<int> Alloc; typedef std::unordered_set<int, Hash, Compare, Alloc> C; - typedef int P; C c1(0, Hash(1), Compare(1), Alloc(1)); C c2(0, Hash(2), Compare(2), Alloc(2)); c2.max_load_factor(2); @@ -394,7 +392,6 @@ int main() typedef test_compare<std::equal_to<int> > Compare; typedef min_allocator<int> Alloc; typedef std::unordered_set<int, Hash, Compare, Alloc> C; - typedef int P; C c1(0, Hash(1), Compare(1), Alloc()); C c2(0, Hash(2), Compare(2), Alloc()); c2.max_load_factor(2); |