aboutsummaryrefslogtreecommitdiff
path: root/test/std/containers
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-04-16 16:03:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-04-16 16:03:23 +0000
commit0dc0969cd0a732760f0aa79942a04e0eaef297c4 (patch)
tree051bdb57b1ac6ee143f61ddbb47bd0da619f6f0c /test/std/containers
parent868847c6900e575417c03bced6e562b3af891318 (diff)
Notes
Diffstat (limited to 'test/std/containers')
-rw-r--r--test/std/containers/associative/map/PR28469_undefined_behavior_segfault.sh.cpp2
-rw-r--r--test/std/containers/associative/map/compare.pass.cpp4
-rw-r--r--test/std/containers/associative/map/incomplete_type.pass.cpp2
-rw-r--r--test/std/containers/associative/map/map.access/index_tuple.pass.cpp2
-rw-r--r--test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp6
-rw-r--r--test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp4
-rw-r--r--test/std/containers/associative/map/map.cons/iter_iter_comp_alloc.pass.cpp2
-rw-r--r--test/std/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp4
-rw-r--r--test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp8
-rw-r--r--test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp11
-rw-r--r--test/std/containers/associative/multimap/incomplete_type.pass.cpp2
-rw-r--r--test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp6
-rw-r--r--test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp4
-rw-r--r--test/std/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp4
-rw-r--r--test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp8
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp1
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/find.pass.cpp1
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp1
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp1
-rw-r--r--test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp11
-rw-r--r--test/std/containers/associative/multiset/incomplete_type.pass.cpp2
-rw-r--r--test/std/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp6
-rw-r--r--test/std/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp4
-rw-r--r--test/std/containers/associative/multiset/multiset.cons/move_assign_noexcept.pass.cpp4
-rw-r--r--test/std/containers/associative/multiset/multiset.cons/move_noexcept.pass.cpp8
-rw-r--r--test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp11
-rw-r--r--test/std/containers/associative/set/incomplete_type.pass.cpp2
-rw-r--r--test/std/containers/associative/set/set.cons/default_noexcept.pass.cpp6
-rw-r--r--test/std/containers/associative/set/set.cons/dtor_noexcept.pass.cpp4
-rw-r--r--test/std/containers/associative/set/set.cons/move_assign_noexcept.pass.cpp4
-rw-r--r--test/std/containers/associative/set/set.cons/move_noexcept.pass.cpp8
-rw-r--r--test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp11
-rw-r--r--test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp4
-rw-r--r--test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp4
-rw-r--r--test/std/containers/sequences/array/array.size/size.pass.cpp4
-rw-r--r--test/std/containers/sequences/array/at.pass.cpp2
-rw-r--r--test/std/containers/sequences/array/front_back.pass.cpp4
-rw-r--r--test/std/containers/sequences/array/indexing.pass.cpp2
-rw-r--r--test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp6
-rw-r--r--test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp6
-rw-r--r--test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp4
-rw-r--r--test/std/containers/sequences/deque/deque.cons/initializer_list.pass.cpp6
-rw-r--r--test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp6
-rw-r--r--test/std/containers/sequences/deque/deque.cons/move.pass.cpp6
-rw-r--r--test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp6
-rw-r--r--test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp6
-rw-r--r--test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp6
-rw-r--r--test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp8
-rw-r--r--test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp6
-rw-r--r--test/std/containers/sequences/deque/deque.cons/size.pass.cpp1
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/insert_iter_initializer_list.pass.cpp4
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp8
-rw-r--r--test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp8
-rw-r--r--test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp6
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/assign_init.pass.cpp6
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/assign_move.pass.cpp6
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/assign_op_init.pass.cpp6
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp6
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp4
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/init.pass.cpp6
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/init_alloc.pass.cpp6
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp6
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp12
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp6
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp8
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/size.fail.cpp35
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp5
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_after.pass.cpp6
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_init.pass.cpp6
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_rv.pass.cpp6
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/pop_front.pass.cpp6
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_rv.pass.cpp6
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.ops/sort.pass.cpp5
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.ops/sort_pred.pass.cpp5
-rw-r--r--test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp6
-rw-r--r--test/std/containers/sequences/list/incomplete_type.pass.cpp2
-rw-r--r--test/std/containers/sequences/list/list.cons/assign_initializer_list.pass.cpp6
-rw-r--r--test/std/containers/sequences/list/list.cons/assign_move.pass.cpp6
-rw-r--r--test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp6
-rw-r--r--test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp4
-rw-r--r--test/std/containers/sequences/list/list.cons/initializer_list.pass.cpp6
-rw-r--r--test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp6
-rw-r--r--test/std/containers/sequences/list/list.cons/move_alloc.pass.cpp6
-rw-r--r--test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp6
-rw-r--r--test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp8
-rw-r--r--test/std/containers/sequences/list/list.cons/op_equal_initializer_list.pass.cpp6
-rw-r--r--test/std/containers/sequences/list/list.cons/size_type.pass.cpp1
-rw-r--r--test/std/containers/sequences/list/list.modifiers/insert_iter_initializer_list.pass.cpp6
-rw-r--r--test/std/containers/sequences/list/list.modifiers/push_back_rvalue.pass.cpp6
-rw-r--r--test/std/containers/sequences/list/list.modifiers/push_front_rvalue.pass.cpp6
-rw-r--r--test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector.bool/assign_initializer_list.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector.bool/assign_move.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector.bool/dtor_noexcept.pass.cpp4
-rw-r--r--test/std/containers/sequences/vector.bool/emplace.pass.cpp4
-rw-r--r--test/std/containers/sequences/vector.bool/enabled_hash.pass.cpp28
-rw-r--r--test/std/containers/sequences/vector.bool/find.pass.cpp2
-rw-r--r--test/std/containers/sequences/vector.bool/initializer_list.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector.bool/initializer_list_alloc.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector.bool/insert_iter_initializer_list.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector.bool/move.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector.bool/move_alloc.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp19
-rw-r--r--test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp15
-rw-r--r--test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp19
-rw-r--r--test/std/containers/sequences/vector.bool/vector_bool.pass.cpp4
-rw-r--r--test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp15
-rw-r--r--test/std/containers/sequences/vector/vector.cons/assign_initializer_list.pass.cpp7
-rw-r--r--test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp4
-rw-r--r--test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector/vector.cons/move.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector/vector.cons/op_equal_initializer_list.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/clear.pass.cpp40
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/insert_iter_initializer_list.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp6
-rw-r--r--test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp4
-rw-r--r--test/std/containers/unord/unord.map/compare.pass.cpp4
-rw-r--r--test/std/containers/unord/unord.map/incomplete_type.pass.cpp2
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/default_noexcept.pass.cpp8
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/dtor_noexcept.pass.cpp8
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/move_assign_noexcept.pass.cpp6
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/move_noexcept.pass.cpp10
-rw-r--r--test/std/containers/unord/unord.map/unord.map.elem/index_tuple.pass.cpp2
-rw-r--r--test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp13
-rw-r--r--test/std/containers/unord/unord.multimap/bucket_count.pass.cpp3
-rw-r--r--test/std/containers/unord/unord.multimap/incomplete.pass.cpp2
-rw-r--r--test/std/containers/unord/unord.multimap/load_factor.pass.cpp2
-rw-r--r--test/std/containers/unord/unord.multimap/max_bucket_count.pass.cpp4
-rw-r--r--test/std/containers/unord/unord.multimap/max_load_factor.pass.cpp4
-rw-r--r--test/std/containers/unord/unord.multimap/swap_member.pass.cpp3
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/default_noexcept.pass.cpp7
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/dtor_noexcept.pass.cpp7
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_assign_noexcept.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_noexcept.pass.cpp9
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp12
-rw-r--r--test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp3
-rw-r--r--test/std/containers/unord/unord.multiset/bucket_count.pass.cpp6
-rw-r--r--test/std/containers/unord/unord.multiset/incomplete.pass.cpp2
-rw-r--r--test/std/containers/unord/unord.multiset/load_factor.pass.cpp2
-rw-r--r--test/std/containers/unord/unord.multiset/max_load_factor.pass.cpp4
-rw-r--r--test/std/containers/unord/unord.multiset/swap_member.pass.cpp3
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default_noexcept.pass.cpp7
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/dtor_noexcept.pass.cpp7
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_assign_noexcept.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_noexcept.pass.cpp9
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_noexcept.pass.cpp11
-rw-r--r--test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_non_member.pass.cpp3
-rw-r--r--test/std/containers/unord/unord.set/bucket_count.pass.cpp6
-rw-r--r--test/std/containers/unord/unord.set/incomplete.pass.cpp2
-rw-r--r--test/std/containers/unord/unord.set/load_factor.pass.cpp2
-rw-r--r--test/std/containers/unord/unord.set/max_load_factor.pass.cpp4
-rw-r--r--test/std/containers/unord/unord.set/swap_member.pass.cpp3
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/default_noexcept.pass.cpp7
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/dtor_noexcept.pass.cpp7
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/move_assign_noexcept.pass.cpp5
-rw-r--r--test/std/containers/unord/unord.set/unord.set.cnstr/move_noexcept.pass.cpp9
-rw-r--r--test/std/containers/unord/unord.set/unord.set.swap/swap_noexcept.pass.cpp11
-rw-r--r--test/std/containers/unord/unord.set/unord.set.swap/swap_non_member.pass.cpp3
167 files changed, 546 insertions, 483 deletions
diff --git a/test/std/containers/associative/map/PR28469_undefined_behavior_segfault.sh.cpp b/test/std/containers/associative/map/PR28469_undefined_behavior_segfault.sh.cpp
index 32d34d90d7f8..646c6be7da61 100644
--- a/test/std/containers/associative/map/PR28469_undefined_behavior_segfault.sh.cpp
+++ b/test/std/containers/associative/map/PR28469_undefined_behavior_segfault.sh.cpp
@@ -13,7 +13,7 @@
// <map>
// Previously this code caused a segfault when compiled at -O2 due to undefined
-// behavior in __tree. See https://llvm.org/bugs/show_bug.cgi?id=28469
+// behavior in __tree. See https://bugs.llvm.org/show_bug.cgi?id=28469
#include <functional>
#include <map>
diff --git a/test/std/containers/associative/map/compare.pass.cpp b/test/std/containers/associative/map/compare.pass.cpp
index 9d1c13d7b8e6..8c429cbd3c4b 100644
--- a/test/std/containers/associative/map/compare.pass.cpp
+++ b/test/std/containers/associative/map/compare.pass.cpp
@@ -13,8 +13,8 @@
// class Allocator = allocator<pair<const Key, T>>>
// class 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 <map>
#include <utility>
diff --git a/test/std/containers/associative/map/incomplete_type.pass.cpp b/test/std/containers/associative/map/incomplete_type.pass.cpp
index 84c2451ce087..6acf83129e12 100644
--- a/test/std/containers/associative/map/incomplete_type.pass.cpp
+++ b/test/std/containers/associative/map/incomplete_type.pass.cpp
@@ -9,7 +9,7 @@
// <map>
-// Check that std::map and it's iterators can be instantiated with an incomplete
+// Check that std::map and its iterators can be instantiated with an incomplete
// type.
#include <map>
diff --git a/test/std/containers/associative/map/map.access/index_tuple.pass.cpp b/test/std/containers/associative/map/map.access/index_tuple.pass.cpp
index 9a00829eadd6..f8fc21f1f2f5 100644
--- a/test/std/containers/associative/map/map.access/index_tuple.pass.cpp
+++ b/test/std/containers/associative/map/map.access/index_tuple.pass.cpp
@@ -13,7 +13,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 <map>
diff --git a/test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp b/test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp
index 817f1207ac94..e06410dcffa2 100644
--- a/test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp
+++ b/test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp
@@ -37,14 +37,16 @@ struct some_comp
int main()
{
typedef std::pair<const MoveOnly, MoveOnly> V;
+#if defined(_LIBCPP_VERSION)
{
typedef std::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::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> 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::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(!std::is_nothrow_default_constructible<C>::value, "");
diff --git a/test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp b/test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp
index a0cf689ed909..7f563b7cf635 100644
--- a/test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp
@@ -43,8 +43,10 @@ int main()
typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::map<MoveOnly, 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/associative/map/map.cons/iter_iter_comp_alloc.pass.cpp b/test/std/containers/associative/map/map.cons/iter_iter_comp_alloc.pass.cpp
index 705fb580487b..923a2124ece4 100644
--- a/test/std/containers/associative/map/map.cons/iter_iter_comp_alloc.pass.cpp
+++ b/test/std/containers/associative/map/map.cons/iter_iter_comp_alloc.pass.cpp
@@ -92,7 +92,6 @@ int main()
V(3, 2),
};
{
- typedef std::pair<const int, double> V;
typedef min_allocator<V> A;
typedef test_compare<std::less<int> > C;
A a;
@@ -106,7 +105,6 @@ int main()
assert(m.get_allocator() == a);
}
{
- typedef std::pair<const int, double> V;
typedef explicit_allocator<V> A;
typedef test_compare<std::less<int> > C;
A a;
diff --git a/test/std/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp b/test/std/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp
index 84f115f1958e..b45e821ad0f9 100644
--- a/test/std/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp
@@ -45,10 +45,12 @@ int main()
typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> 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::map<MoveOnly, MoveOnly, some_comp<MoveOnly>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
diff --git a/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp b/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp
index b5301418e85a..84a9609742d3 100644
--- a/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp
@@ -34,19 +34,21 @@ struct some_comp
int main()
{
+#if defined(_LIBCPP_VERSION)
typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::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::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
+ static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> 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::map<MoveOnly, MoveOnly, some_comp<MoveOnly>> C;
static_assert(!std::is_nothrow_move_constructible<C>::value, "");
diff --git a/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp b/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp
index 84907945a90e..c1aa033845ec 100644
--- a/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp
@@ -99,14 +99,16 @@ int main()
typedef std::map<MoveOnly, MoveOnly> C;
static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::map<MoveOnly, MoveOnly, std::less<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::map<MoveOnly, MoveOnly, std::less<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::map<MoveOnly, MoveOnly, some_comp<MoveOnly>> C;
static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
@@ -129,11 +131,12 @@ int main()
typedef std::map<MoveOnly, 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 comp
typedef std::map<MoveOnly, 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/associative/multimap/incomplete_type.pass.cpp b/test/std/containers/associative/multimap/incomplete_type.pass.cpp
index c461eb38139d..306f3d9761f1 100644
--- a/test/std/containers/associative/multimap/incomplete_type.pass.cpp
+++ b/test/std/containers/associative/multimap/incomplete_type.pass.cpp
@@ -9,7 +9,7 @@
// <map>
-// Check that std::multimap and it's iterators can be instantiated with an incomplete
+// Check that std::multimap and its iterators can be instantiated with an incomplete
// type.
#include <map>
diff --git a/test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp
index 6f97a5f3e756..6020334ed26b 100644
--- a/test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp
@@ -37,14 +37,16 @@ struct some_comp
int main()
{
typedef std::pair<const MoveOnly, MoveOnly> V;
+#if defined(_LIBCPP_VERSION)
{
typedef std::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::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> 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::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(!std::is_nothrow_default_constructible<C>::value, "");
diff --git a/test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp
index 669d23db57cd..2486e8f243cf 100644
--- a/test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp
@@ -43,8 +43,10 @@ int main()
typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::multimap<MoveOnly, 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/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp
index 7637885c81e1..549c1210b6f2 100644
--- a/test/std/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp
@@ -45,10 +45,12 @@ int main()
typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> 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::multimap<MoveOnly, MoveOnly, some_comp<MoveOnly>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
diff --git a/test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp
index e42251527eb3..fdcdffbedb4b 100644
--- a/test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp
@@ -34,19 +34,21 @@ struct some_comp
int main()
{
+#if defined(_LIBCPP_VERSION)
typedef std::pair<const MoveOnly, MoveOnly> V;
{
typedef std::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::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
+ static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> 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::multimap<MoveOnly, MoveOnly, some_comp<MoveOnly>> C;
static_assert(!std::is_nothrow_move_constructible<C>::value, "");
diff --git a/test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp
index df46d376e028..9e67f97f9ac0 100644
--- a/test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp
@@ -183,7 +183,6 @@ int main()
#endif
#if TEST_STD_VER > 11
{
- typedef std::pair<const int, double> V;
typedef std::multimap<int, double, std::less<>> M;
typedef std::pair<M::iterator, M::iterator> R;
diff --git a/test/std/containers/associative/multimap/multimap.ops/find.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/find.pass.cpp
index f5295e52d192..474b7b6ac59c 100644
--- a/test/std/containers/associative/multimap/multimap.ops/find.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/find.pass.cpp
@@ -147,7 +147,6 @@ int main()
#endif
#if TEST_STD_VER > 11
{
- typedef std::pair<const int, double> V;
typedef std::multimap<int, double, std::less<>> M;
typedef M::iterator R;
diff --git a/test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp
index 8a650fa55975..28ff332542b4 100644
--- a/test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp
@@ -155,7 +155,6 @@ int main()
#endif
#if TEST_STD_VER > 11
{
- typedef std::pair<const int, double> V;
typedef std::multimap<int, double, std::less<>> M;
typedef M::iterator R;
V ar[] =
diff --git a/test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp
index 05760dc0e751..4f4b3884f28e 100644
--- a/test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp
@@ -155,7 +155,6 @@ int main()
#endif
#if TEST_STD_VER > 11
{
- typedef std::pair<const int, double> V;
typedef std::multimap<int, double, std::less<>> M;
typedef M::iterator R;
V ar[] =
diff --git a/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp b/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp
index ecc9c7ef5fd4..8148ea5b27ed 100644
--- a/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp
@@ -99,14 +99,16 @@ int main()
typedef std::multimap<MoveOnly, MoveOnly> C;
static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::multimap<MoveOnly, MoveOnly, std::less<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::multimap<MoveOnly, MoveOnly, std::less<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::multimap<MoveOnly, MoveOnly, some_comp<MoveOnly>> C;
static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
@@ -129,10 +131,11 @@ int main()
typedef std::multimap<MoveOnly, 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 comp
typedef std::multimap<MoveOnly, 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/associative/multiset/incomplete_type.pass.cpp b/test/std/containers/associative/multiset/incomplete_type.pass.cpp
index 0355e18f9f29..aecd77a18367 100644
--- a/test/std/containers/associative/multiset/incomplete_type.pass.cpp
+++ b/test/std/containers/associative/multiset/incomplete_type.pass.cpp
@@ -9,7 +9,7 @@
// <set>
-// Check that std::multiset and it's iterators can be instantiated with an incomplete
+// Check that std::multiset and its iterators can be instantiated with an incomplete
// type.
#include <set>
diff --git a/test/std/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp
index 15520e7834ff..3156003232db 100644
--- a/test/std/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp
+++ b/test/std/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp
@@ -36,14 +36,16 @@ struct some_comp
int main()
{
+#if defined(_LIBCPP_VERSION)
{
typedef std::multiset<MoveOnly> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
+ static_assert(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::multiset<MoveOnly, std::less<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::multiset<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
static_assert(!std::is_nothrow_default_constructible<C>::value, "");
diff --git a/test/std/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp
index b4b9d067704b..096696fcd94c 100644
--- a/test/std/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp
@@ -42,8 +42,10 @@ int main()
typedef std::multiset<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::multiset<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/associative/multiset/multiset.cons/move_assign_noexcept.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/move_assign_noexcept.pass.cpp
index bae97cf4e48a..18d64bc5f2c8 100644
--- a/test/std/containers/associative/multiset/multiset.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/associative/multiset/multiset.cons/move_assign_noexcept.pass.cpp
@@ -44,10 +44,12 @@ int main()
typedef std::multiset<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::multiset<MoveOnly, std::less<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::multiset<MoveOnly, some_comp<MoveOnly>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
diff --git a/test/std/containers/associative/multiset/multiset.cons/move_noexcept.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/move_noexcept.pass.cpp
index 69759e03a28a..eab1787ec881 100644
--- a/test/std/containers/associative/multiset/multiset.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/associative/multiset/multiset.cons/move_noexcept.pass.cpp
@@ -34,18 +34,20 @@ struct some_comp
int main()
{
+#if defined(_LIBCPP_VERSION)
{
typedef std::multiset<MoveOnly> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
+ static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::multiset<MoveOnly, std::less<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::multiset<MoveOnly, std::less<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::multiset<MoveOnly, some_comp<MoveOnly>> C;
static_assert(!std::is_nothrow_move_constructible<C>::value, "");
diff --git a/test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp b/test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp
index 89fabef0a3a0..9693ffb15903 100644
--- a/test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp
@@ -98,14 +98,16 @@ int main()
typedef std::multiset<MoveOnly> C;
static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::multiset<MoveOnly, std::less<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::multiset<MoveOnly, std::less<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::multiset<MoveOnly, some_comp<MoveOnly>> C;
static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
@@ -128,10 +130,11 @@ int main()
typedef std::multiset<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 comp
typedef std::multiset<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/associative/set/incomplete_type.pass.cpp b/test/std/containers/associative/set/incomplete_type.pass.cpp
index d3a1d6638d7e..a200223051c8 100644
--- a/test/std/containers/associative/set/incomplete_type.pass.cpp
+++ b/test/std/containers/associative/set/incomplete_type.pass.cpp
@@ -9,7 +9,7 @@
// <set>
-// Check that std::set and it's iterators can be instantiated with an incomplete
+// Check that std::set and its iterators can be instantiated with an incomplete
// type.
#include <set>
diff --git a/test/std/containers/associative/set/set.cons/default_noexcept.pass.cpp b/test/std/containers/associative/set/set.cons/default_noexcept.pass.cpp
index 6293c24a43d3..d32cc3f48fef 100644
--- a/test/std/containers/associative/set/set.cons/default_noexcept.pass.cpp
+++ b/test/std/containers/associative/set/set.cons/default_noexcept.pass.cpp
@@ -36,14 +36,16 @@ struct some_comp
int main()
{
+#if defined(_LIBCPP_VERSION)
{
typedef std::set<MoveOnly> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
+ static_assert(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::set<MoveOnly, std::less<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::set<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
static_assert(!std::is_nothrow_default_constructible<C>::value, "");
diff --git a/test/std/containers/associative/set/set.cons/dtor_noexcept.pass.cpp b/test/std/containers/associative/set/set.cons/dtor_noexcept.pass.cpp
index 041f599c1f76..c91038e39040 100644
--- a/test/std/containers/associative/set/set.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/associative/set/set.cons/dtor_noexcept.pass.cpp
@@ -42,8 +42,10 @@ int main()
typedef std::set<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::set<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/associative/set/set.cons/move_assign_noexcept.pass.cpp b/test/std/containers/associative/set/set.cons/move_assign_noexcept.pass.cpp
index ce44b69fe336..c07d4e6f9b88 100644
--- a/test/std/containers/associative/set/set.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/associative/set/set.cons/move_assign_noexcept.pass.cpp
@@ -44,10 +44,12 @@ int main()
typedef std::set<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::set<MoveOnly, std::less<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::set<MoveOnly, some_comp<MoveOnly>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
diff --git a/test/std/containers/associative/set/set.cons/move_noexcept.pass.cpp b/test/std/containers/associative/set/set.cons/move_noexcept.pass.cpp
index 9a7538ca31bd..901fdbdb321c 100644
--- a/test/std/containers/associative/set/set.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/associative/set/set.cons/move_noexcept.pass.cpp
@@ -34,18 +34,20 @@ struct some_comp
int main()
{
+#if defined(_LIBCPP_VERSION)
{
typedef std::set<MoveOnly> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
+ static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::set<MoveOnly, std::less<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::set<MoveOnly, std::less<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::set<MoveOnly, some_comp<MoveOnly>> C;
static_assert(!std::is_nothrow_move_constructible<C>::value, "");
diff --git a/test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp b/test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp
index b3edd31f749b..38b0ab8151aa 100644
--- a/test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp
@@ -98,14 +98,16 @@ int main()
typedef std::set<MoveOnly> C;
static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::set<MoveOnly, std::less<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::set<MoveOnly, std::less<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::set<MoveOnly, some_comp<MoveOnly>> C;
static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
@@ -128,11 +130,12 @@ int main()
typedef std::set<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 comp
typedef std::set<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/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp
index c79feb93eb6c..5dec2b910fb7 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp
@@ -25,8 +25,10 @@
int main()
{
+#if defined(_LIBCPP_VERSION)
{
typedef std::priority_queue<MoveOnly> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
+ static_assert(std::is_nothrow_default_constructible<C>::value, "");
}
+#endif // _LIBCPP_VERSION
}
diff --git a/test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp
index 43045893fe07..781d74016128 100644
--- a/test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp
@@ -24,8 +24,10 @@
int main()
{
+#if defined(_LIBCPP_VERSION)
{
typedef std::queue<MoveOnly> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
+ static_assert(std::is_nothrow_default_constructible<C>::value, "");
}
+#endif // _LIBCPP_VERSION
}
diff --git a/test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp
index c8becb3ca98a..58c8f9ddfad1 100644
--- a/test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp
@@ -24,8 +24,10 @@
int main()
{
+#if defined(_LIBCPP_VERSION)
{
typedef std::queue<MoveOnly> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
+ static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
+#endif // _LIBCPP_VERSION
}
diff --git a/test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp
index 2d1f9437fc45..2e217c545f9c 100644
--- a/test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp
@@ -24,8 +24,10 @@
int main()
{
+#if defined(_LIBCPP_VERSION)
{
typedef std::stack<MoveOnly> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
+ static_assert(std::is_nothrow_default_constructible<C>::value, "");
}
+#endif // _LIBCPP_VERSION
}
diff --git a/test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp
index c34b7e07000e..af6793f465a2 100644
--- a/test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp
@@ -24,8 +24,10 @@
int main()
{
+#if defined(_LIBCPP_VERSION)
{
typedef std::stack<MoveOnly> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
+ static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
+#endif // _LIBCPP_VERSION
}
diff --git a/test/std/containers/sequences/array/array.size/size.pass.cpp b/test/std/containers/sequences/array/array.size/size.pass.cpp
index a833fdc04715..2fe5355124ae 100644
--- a/test/std/containers/sequences/array/array.size/size.pass.cpp
+++ b/test/std/containers/sequences/array/array.size/size.pass.cpp
@@ -14,6 +14,8 @@
#include <array>
#include <cassert>
+#include "test_macros.h"
+
// std::array is explicitly allowed to be initialized with A a = { init-list };.
// Disable the missing braces warning for this reason.
#include "disable_missing_braces_warning.h"
@@ -36,7 +38,7 @@ int main()
assert(c.max_size() == 0);
assert(c.empty());
}
-#ifndef _LIBCPP_HAS_NO_CONSTEXPR
+#if TEST_STD_VER >= 11
{
typedef double T;
typedef std::array<T, 3> C;
diff --git a/test/std/containers/sequences/array/at.pass.cpp b/test/std/containers/sequences/array/at.pass.cpp
index 8e7ff6dff702..efec4e403001 100644
--- a/test/std/containers/sequences/array/at.pass.cpp
+++ b/test/std/containers/sequences/array/at.pass.cpp
@@ -25,7 +25,7 @@
#if TEST_STD_VER > 14
constexpr bool check_idx( size_t idx, double val )
-{
+{
std::array<double, 3> arr = {1, 2, 3.5};
return arr.at(idx) == val;
}
diff --git a/test/std/containers/sequences/array/front_back.pass.cpp b/test/std/containers/sequences/array/front_back.pass.cpp
index 239fda5c99d8..68fc6cdc4543 100644
--- a/test/std/containers/sequences/array/front_back.pass.cpp
+++ b/test/std/containers/sequences/array/front_back.pass.cpp
@@ -25,13 +25,13 @@
#if TEST_STD_VER > 14
constexpr bool check_front( double val )
-{
+{
std::array<double, 3> arr = {1, 2, 3.5};
return arr.front() == val;
}
constexpr bool check_back( double val )
-{
+{
std::array<double, 3> arr = {1, 2, 3.5};
return arr.back() == val;
}
diff --git a/test/std/containers/sequences/array/indexing.pass.cpp b/test/std/containers/sequences/array/indexing.pass.cpp
index 6cb7941d92c5..3a5b9ee9727d 100644
--- a/test/std/containers/sequences/array/indexing.pass.cpp
+++ b/test/std/containers/sequences/array/indexing.pass.cpp
@@ -25,7 +25,7 @@
#if TEST_STD_VER > 14
constexpr bool check_idx( size_t idx, double val )
-{
+{
std::array<double, 3> arr = {1, 2, 3.5};
return arr[idx] == val;
}
diff --git a/test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp b/test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp
index dea6492a515d..fdb751da6aaf 100644
--- a/test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <deque>
// void assign(initializer_list<value_type> il);
@@ -18,7 +20,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
std::deque<int> d;
d.assign({3, 4, 5, 6});
@@ -28,7 +29,6 @@ int main()
assert(d[2] == 5);
assert(d[3] == 6);
}
-#if TEST_STD_VER >= 11
{
std::deque<int, min_allocator<int>> d;
d.assign({3, 4, 5, 6});
@@ -38,6 +38,4 @@ int main()
assert(d[2] == 5);
assert(d[3] == 6);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp b/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp
index 30cca929da11..e79e6eca3d95 100644
--- a/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp
@@ -32,14 +32,16 @@ struct some_alloc
int main()
{
+#if defined(_LIBCPP_VERSION)
{
typedef std::deque<MoveOnly> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
+ static_assert(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::deque<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::deque<MoveOnly, other_allocator<MoveOnly>> C;
static_assert(!std::is_nothrow_default_constructible<C>::value, "");
diff --git a/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp b/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp
index 59955157421d..288810089e59 100644
--- a/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp
@@ -42,8 +42,10 @@ int main()
typedef std::deque<MoveOnly, other_allocator<MoveOnly>> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::deque<MoveOnly, some_alloc<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/sequences/deque/deque.cons/initializer_list.pass.cpp b/test/std/containers/sequences/deque/deque.cons/initializer_list.pass.cpp
index dbf27053a9f9..dd70cda1845b 100644
--- a/test/std/containers/sequences/deque/deque.cons/initializer_list.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/initializer_list.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <deque>
// deque(initializer_list<value_type> il);
@@ -18,7 +20,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
std::deque<int> d = {3, 4, 5, 6};
assert(d.size() == 4);
@@ -27,7 +28,6 @@ int main()
assert(d[2] == 5);
assert(d[3] == 6);
}
-#if TEST_STD_VER >= 11
{
std::deque<int, min_allocator<int>> d = {3, 4, 5, 6};
assert(d.size() == 4);
@@ -36,6 +36,4 @@ int main()
assert(d[2] == 5);
assert(d[3] == 6);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp b/test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp
index 9be3c63a6b31..2619569e154e 100644
--- a/test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <deque>
// deque(initializer_list<value_type> il, const Allocator& a = allocator_type());
@@ -19,7 +21,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
std::deque<int, test_allocator<int>> d({3, 4, 5, 6}, test_allocator<int>(3));
assert(d.get_allocator() == test_allocator<int>(3));
@@ -29,7 +30,6 @@ int main()
assert(d[2] == 5);
assert(d[3] == 6);
}
-#if TEST_STD_VER >= 11
{
std::deque<int, min_allocator<int>> d({3, 4, 5, 6}, min_allocator<int>());
assert(d.get_allocator() == min_allocator<int>());
@@ -39,6 +39,4 @@ int main()
assert(d[2] == 5);
assert(d[3] == 6);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/deque/deque.cons/move.pass.cpp b/test/std/containers/sequences/deque/deque.cons/move.pass.cpp
index 68875139da1a..6e935a52bb24 100644
--- a/test/std/containers/sequences/deque/deque.cons/move.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/move.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <deque>
// deque(deque&&);
@@ -20,7 +22,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
int* an = ab + sizeof(ab)/sizeof(ab[0]);
@@ -51,7 +52,6 @@ int main()
assert(c1.size() == 0);
assert(c3.get_allocator() == c1.get_allocator());
}
-#if TEST_STD_VER >= 11
{
int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
int* an = ab + sizeof(ab)/sizeof(ab[0]);
@@ -67,6 +67,4 @@ int main()
assert(c1.size() == 0);
assert(c3.get_allocator() == c1.get_allocator());
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp b/test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp
index 4aa0fa6827e7..5a9a77c746fc 100644
--- a/test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <deque>
// deque(deque&& c, const allocator_type& a);
@@ -20,7 +22,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
int* an = ab + sizeof(ab)/sizeof(ab[0]);
@@ -66,7 +67,6 @@ int main()
assert(c3.get_allocator() == A(3));
assert(c1.size() != 0);
}
-#if TEST_STD_VER >= 11
{
int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
int* an = ab + sizeof(ab)/sizeof(ab[0]);
@@ -82,6 +82,4 @@ int main()
assert(c3.get_allocator() == A());
assert(c1.size() == 0);
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp b/test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp
index ed8f1544bc8f..8a65bc2d2e84 100644
--- a/test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <deque>
// deque& operator=(deque&& c);
@@ -20,7 +22,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
int* an = ab + sizeof(ab)/sizeof(ab[0]);
@@ -69,7 +70,6 @@ int main()
assert(c1.size() == 0);
assert(c3.get_allocator() == A(5));
}
-#if TEST_STD_VER >= 11
{
int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
int* an = ab + sizeof(ab)/sizeof(ab[0]);
@@ -86,6 +86,4 @@ int main()
assert(c1.size() == 0);
assert(c3.get_allocator() == A());
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp b/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp
index 9b813ce342a3..6ea72246fa05 100644
--- a/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp
@@ -42,12 +42,14 @@ int main()
typedef std::deque<MoveOnly, test_allocator<MoveOnly>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::deque<MoveOnly, other_allocator<MoveOnly>> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
+ static_assert(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::deque<MoveOnly, some_alloc<MoveOnly>> C;
- LIBCPP_STATIC_ASSERT(!std::is_nothrow_move_assignable<C>::value, "");
+ static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}
+#endif // _LIBCPP_VERSION
}
diff --git a/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp b/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp
index e0669dc70ca9..fdf67d23a12d 100644
--- a/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp
@@ -32,18 +32,20 @@ struct some_alloc
int main()
{
+#if defined(_LIBCPP_VERSION)
{
typedef std::deque<MoveOnly> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
+ static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::deque<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::deque<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::deque<MoveOnly, some_alloc<MoveOnly>> C;
static_assert(!std::is_nothrow_move_constructible<C>::value, "");
diff --git a/test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp b/test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp
index 597f642db3ce..117e942895ba 100644
--- a/test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <deque>
// deque& operator=(initializer_list<value_type> il);
@@ -18,7 +20,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
std::deque<int> d;
d = {3, 4, 5, 6};
@@ -28,7 +29,6 @@ int main()
assert(d[2] == 5);
assert(d[3] == 6);
}
-#if TEST_STD_VER >= 11
{
std::deque<int, min_allocator<int>> d;
d = {3, 4, 5, 6};
@@ -38,6 +38,4 @@ int main()
assert(d[2] == 5);
assert(d[3] == 6);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/deque/deque.cons/size.pass.cpp b/test/std/containers/sequences/deque/deque.cons/size.pass.cpp
index 64b3d811fdc9..de7894234df3 100644
--- a/test/std/containers/sequences/deque/deque.cons/size.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/size.pass.cpp
@@ -68,7 +68,6 @@ test3(unsigned n, Allocator const &alloc = Allocator())
{
#if TEST_STD_VER > 11
typedef std::deque<T, Allocator> C;
- typedef typename C::const_iterator const_iterator;
{
C d(n, alloc);
assert(d.size() == n);
diff --git a/test/std/containers/sequences/deque/deque.modifiers/insert_iter_initializer_list.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/insert_iter_initializer_list.pass.cpp
index 5f7804023c7f..6d33424fe410 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/insert_iter_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/insert_iter_initializer_list.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <deque>
// iterator insert(const_iterator p, initializer_list<value_type> il);
@@ -18,7 +20,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
std::deque<int> d(10, 1);
std::deque<int>::iterator i = d.insert(d.cbegin() + 2, {3, 4, 5, 6});
@@ -59,5 +60,4 @@ int main()
assert(d[12] == 1);
assert(d[13] == 1);
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp
index b5c881064a95..060d83b5e254 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <deque>
// void push_back(value_type&& v);
@@ -19,7 +21,6 @@
#include "MoveOnly.h"
#include "min_allocator.h"
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class C>
C
@@ -57,24 +58,19 @@ void test(int size)
}
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2046, 2047, 2048, 2049, 4094, 4095, 4096};
const int N = sizeof(rng)/sizeof(rng[0]);
for (int j = 0; j < N; ++j)
test<std::deque<MoveOnly> >(rng[j]);
}
-#if TEST_STD_VER >= 11
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2046, 2047, 2048, 2049, 4094, 4095, 4096};
const int N = sizeof(rng)/sizeof(rng[0]);
for (int j = 0; j < N; ++j)
test<std::deque<MoveOnly, min_allocator<MoveOnly>> >(rng[j]);
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp
index 8e734a639344..df3d2d099c70 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <deque>
// void push_front(value_type&& v);
@@ -18,7 +20,6 @@
#include "MoveOnly.h"
#include "min_allocator.h"
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class C>
C
@@ -66,11 +67,9 @@ testN(int start, int N)
test(c1, -10);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng)/sizeof(rng[0]);
@@ -78,7 +77,6 @@ int main()
for (int j = 0; j < N; ++j)
testN<std::deque<MoveOnly> >(rng[i], rng[j]);
}
-#if TEST_STD_VER >= 11
{
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
const int N = sizeof(rng)/sizeof(rng[0]);
@@ -86,6 +84,4 @@ int main()
for (int j = 0; j < N; ++j)
testN<std::deque<MoveOnly, min_allocator<MoveOnly>> >(rng[i], rng[j]);
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp b/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp
index c0af762fb277..0db30a031282 100644
--- a/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp
@@ -59,14 +59,16 @@ int main()
typedef std::deque<MoveOnly> C;
static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::deque<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::deque<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::deque<MoveOnly, some_alloc<MoveOnly>> C;
#if TEST_STD_VER >= 14
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_init.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_init.pass.cpp
index d4dda02b8413..69fb6eb4ca4d 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_init.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_init.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <forward_list>
// void assign(initializer_list<value_type> il);
@@ -19,7 +21,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
typedef int T;
typedef std::forward_list<T> C;
@@ -42,7 +43,6 @@ int main()
assert(*i == 10+n);
assert(n == 4);
}
-#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
@@ -65,6 +65,4 @@ int main()
assert(*i == 10+n);
assert(n == 4);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_move.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_move.pass.cpp
index 935284831d07..61118353dfb2 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_move.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_move.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <forward_list>
// forward_list& operator=(forward_list&& x);
@@ -21,7 +23,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef MoveOnly T;
typedef test_allocator<T> A;
@@ -159,7 +160,6 @@ int main()
assert(c1.get_allocator() == A(10));
assert(c0.empty());
}
-#if TEST_STD_VER >= 11
{
typedef MoveOnly T;
typedef min_allocator<T> A;
@@ -194,6 +194,4 @@ int main()
assert(c1.get_allocator() == A());
assert(c0.empty());
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_op_init.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_op_init.pass.cpp
index 3d35916ccacb..84f1eb9963fd 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_op_init.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_op_init.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <forward_list>
// forward_list& operator=(initializer_list<value_type> il);
@@ -19,7 +21,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
typedef int T;
typedef std::forward_list<T> C;
@@ -42,7 +43,6 @@ int main()
assert(*i == 10+n);
assert(n == 4);
}
-#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
@@ -65,6 +65,4 @@ int main()
assert(*i == 10+n);
assert(n == 4);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp
index 0ec1f80562a8..57f09d7cefeb 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp
@@ -32,14 +32,16 @@ struct some_alloc
int main()
{
+#if defined(_LIBCPP_VERSION)
{
typedef std::forward_list<MoveOnly> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
+ static_assert(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::forward_list<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::forward_list<MoveOnly, other_allocator<MoveOnly>> C;
static_assert(!std::is_nothrow_default_constructible<C>::value, "");
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp
index f70119e3c2af..4d295d662da1 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp
@@ -42,8 +42,10 @@ int main()
typedef std::forward_list<MoveOnly, other_allocator<MoveOnly>> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::forward_list<MoveOnly, some_alloc<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/sequences/forwardlist/forwardlist.cons/init.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/init.pass.cpp
index ac73d142a67e..7575c0e81242 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/init.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/init.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <forward_list>
// forward_list(initializer_list<value_type> il);
@@ -18,7 +20,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
typedef int T;
typedef std::forward_list<T> C;
@@ -28,7 +29,6 @@ int main()
assert(*i == n);
assert(n == 10);
}
-#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
@@ -38,6 +38,4 @@ int main()
assert(*i == n);
assert(n == 10);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/init_alloc.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/init_alloc.pass.cpp
index 844be20015dd..cf9cbffa7304 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/init_alloc.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/init_alloc.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <forward_list>
// forward_list(initializer_list<value_type> il, const allocator_type& a);
@@ -19,7 +21,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
typedef int T;
typedef test_allocator<T> A;
@@ -31,7 +32,6 @@ int main()
assert(n == 10);
assert(c.get_allocator() == A(14));
}
-#if TEST_STD_VER >= 11
{
typedef int T;
typedef min_allocator<T> A;
@@ -43,6 +43,4 @@ int main()
assert(n == 10);
assert(c.get_allocator() == A());
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp
index a5948b9ef799..92a9e39fc94b 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <forward_list>
// forward_list(forward_list&& x);
@@ -21,7 +23,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef MoveOnly T;
typedef test_allocator<T> A;
@@ -52,7 +53,6 @@ int main()
assert(c0.empty());
assert(c.get_allocator() == A(10));
}
-#if TEST_STD_VER >= 11
{
typedef MoveOnly T;
typedef min_allocator<T> A;
@@ -68,6 +68,4 @@ int main()
assert(c0.empty());
assert(c.get_allocator() == A());
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp
index 6a1afe1334b0..5f5f5d0aef60 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <forward_list>
// forward_list(forward_list&& x, const allocator_type& a);
@@ -21,7 +23,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef MoveOnly T;
typedef test_allocator<T> A;
@@ -33,7 +34,7 @@ int main()
unsigned n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
- assert(n == std::end(t) - std::begin(t));
+ assert(n == static_cast<unsigned>(std::end(t) - std::begin(t)));
assert(c0.empty());
assert(c.get_allocator() == A(10));
}
@@ -48,11 +49,10 @@ int main()
unsigned n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
- assert(n == std::end(t) - std::begin(t));
+ assert(n == static_cast<unsigned>(std::end(t) - std::begin(t)));
assert(!c0.empty());
assert(c.get_allocator() == A(9));
}
-#if TEST_STD_VER >= 11
{
typedef MoveOnly T;
typedef min_allocator<T> A;
@@ -64,10 +64,8 @@ int main()
unsigned n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == n);
- assert(n == std::end(t) - std::begin(t));
+ assert(n == static_cast<unsigned>(std::end(t) - std::begin(t)));
assert(c0.empty());
assert(c.get_allocator() == A());
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp
index 5f278e31c0de..d4fe2591898a 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp
@@ -42,12 +42,14 @@ int main()
typedef std::forward_list<MoveOnly, test_allocator<MoveOnly>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::forward_list<MoveOnly, other_allocator<MoveOnly>> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
+ static_assert(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::forward_list<MoveOnly, some_alloc<MoveOnly>> C;
- LIBCPP_STATIC_ASSERT(!std::is_nothrow_move_assignable<C>::value, "");
+ static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}
+#endif // _LIBCPP_VERSION
}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp
index 089f6d6807cb..3390c331e00e 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp
@@ -32,18 +32,20 @@ struct some_alloc
int main()
{
+#if defined(_LIBCPP_VERSION)
{
typedef std::forward_list<MoveOnly> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
+ static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::forward_list<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::forward_list<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::forward_list<MoveOnly, some_alloc<MoveOnly>> C;
static_assert(!std::is_nothrow_move_constructible<C>::value, "");
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/size.fail.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/size.fail.cpp
deleted file mode 100644
index 2d963a1be479..000000000000
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/size.fail.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <forward_list>
-
-// explicit forward_list(size_type n);
-
-#include <forward_list>
-#include <cassert>
-
-#include "DefaultOnly.h"
-
-int main()
-{
- {
- typedef DefaultOnly T;
- typedef std::forward_list<T> C;
- unsigned N = 10;
- C c = N;
- unsigned n = 0;
- for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- assert(*i == T());
-#else
- ;
-#endif
- assert(n == N);
- }
-}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
index b536ccf4910e..061dd6da0785 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
@@ -36,6 +36,11 @@ void check_allocator(unsigned n, Allocator const &alloc = Allocator())
int main()
{
+ { // test that the ctor is explicit
+ typedef std::forward_list<DefaultOnly> C;
+ static_assert((std::is_constructible<C, size_t>::value), "");
+ static_assert((!std::is_convertible<size_t, C>::value), "");
+ }
{
typedef DefaultOnly T;
typedef std::forward_list<T> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_after.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_after.pass.cpp
index dd8ea88c2c1a..8d7c4e9893a2 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_after.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_after.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <forward_list>
// template <class... Args>
@@ -20,7 +22,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef Emplaceable T;
typedef std::forward_list<T> C;
@@ -52,7 +53,6 @@ int main()
assert(*next(c.begin(), 3) == Emplaceable(2, 3.5));
assert(distance(c.begin(), c.end()) == 4);
}
-#if TEST_STD_VER >= 11
{
typedef Emplaceable T;
typedef std::forward_list<T, min_allocator<T>> C;
@@ -84,6 +84,4 @@ int main()
assert(*next(c.begin(), 3) == Emplaceable(2, 3.5));
assert(distance(c.begin(), c.end()) == 4);
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_init.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_init.pass.cpp
index 15e1a08b08bf..90ee0d2313ff 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_init.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_init.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <forward_list>
// iterator insert_after(const_iterator p, initializer_list<value_type> il);
@@ -18,7 +20,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
typedef int T;
typedef std::forward_list<T> C;
@@ -44,7 +45,6 @@ int main()
assert(*next(c.begin(), 3) == 1);
assert(*next(c.begin(), 4) == 2);
}
-#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
@@ -70,6 +70,4 @@ int main()
assert(*next(c.begin(), 3) == 1);
assert(*next(c.begin(), 4) == 2);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_rv.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_rv.pass.cpp
index 2e21cc79d269..173ccaa62d9f 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_rv.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_rv.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <forward_list>
// iterator insert_after(const_iterator p, value_type&& v);
@@ -19,7 +21,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef MoveOnly T;
typedef std::forward_list<T> C;
@@ -52,7 +53,6 @@ int main()
assert(*next(c.begin(), 3) == 2);
assert(distance(c.begin(), c.end()) == 4);
}
-#if TEST_STD_VER >= 11
{
typedef MoveOnly T;
typedef std::forward_list<T, min_allocator<T>> C;
@@ -85,6 +85,4 @@ int main()
assert(*next(c.begin(), 3) == 2);
assert(distance(c.begin(), c.end()) == 4);
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/pop_front.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/pop_front.pass.cpp
index d831ceb28918..545b0e68a24b 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/pop_front.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/pop_front.pass.cpp
@@ -32,7 +32,7 @@ int main()
c.pop_front();
assert(distance(c.begin(), c.end()) == 0);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
typedef MoveOnly T;
typedef std::forward_list<T> C;
@@ -45,8 +45,6 @@ int main()
c.pop_front();
assert(distance(c.begin(), c.end()) == 0);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#if TEST_STD_VER >= 11
{
typedef int T;
typedef std::forward_list<T, min_allocator<T>> C;
@@ -60,7 +58,6 @@ int main()
c.pop_front();
assert(distance(c.begin(), c.end()) == 0);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef MoveOnly T;
typedef std::forward_list<T, min_allocator<T>> C;
@@ -73,6 +70,5 @@ int main()
c.pop_front();
assert(distance(c.begin(), c.end()) == 0);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
#endif
}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_rv.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_rv.pass.cpp
index dfcd2cf90ebc..7fc2b9d76567 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_rv.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_rv.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <forward_list>
// void push_front(value_type&& v);
@@ -19,7 +21,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
typedef MoveOnly T;
typedef std::forward_list<T> C;
@@ -32,7 +33,6 @@ int main()
assert(*next(c.begin()) == 1);
assert(distance(c.begin(), c.end()) == 2);
}
-#if TEST_STD_VER >= 11
{
typedef MoveOnly T;
typedef std::forward_list<T, min_allocator<T>> C;
@@ -45,6 +45,4 @@ int main()
assert(*next(c.begin()) == 1);
assert(distance(c.begin(), c.end()) == 2);
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.ops/sort.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.ops/sort.pass.cpp
index 65512e317cea..397f209f7226 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.ops/sort.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.ops/sort.pass.cpp
@@ -15,10 +15,13 @@
#include <iterator>
#include <algorithm>
#include <vector>
+#include <random>
#include <cassert>
#include "min_allocator.h"
+std::mt19937 randomness;
+
template <class C>
void test(int N)
{
@@ -27,7 +30,7 @@ void test(int N)
V v;
for (int i = 0; i < N; ++i)
v.push_back(i);
- std::random_shuffle(v.begin(), v.end());
+ std::shuffle(v.begin(), v.end(), randomness);
C c(v.begin(), v.end());
c.sort();
assert(distance(c.begin(), c.end()) == N);
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.ops/sort_pred.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.ops/sort_pred.pass.cpp
index 6e5cce39e67d..ab6ae6bd327b 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.ops/sort_pred.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.ops/sort_pred.pass.cpp
@@ -16,10 +16,13 @@
#include <algorithm>
#include <vector>
#include <functional>
+#include <random>
#include <cassert>
#include "min_allocator.h"
+std::mt19937 randomness;
+
template <class C>
void test(int N)
{
@@ -28,7 +31,7 @@ void test(int N)
V v;
for (int i = 0; i < N; ++i)
v.push_back(i);
- std::random_shuffle(v.begin(), v.end());
+ std::shuffle(v.begin(), v.end(), randomness);
C c(v.begin(), v.end());
c.sort(std::greater<T>());
assert(distance(c.begin(), c.end()) == N);
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
index c63194f7ee64..d93c079e15ed 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
@@ -59,14 +59,16 @@ int main()
typedef std::forward_list<MoveOnly> C;
static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::forward_list<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::forward_list<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::forward_list<MoveOnly, some_alloc<MoveOnly>> C;
#if TEST_STD_VER >= 14
diff --git a/test/std/containers/sequences/list/incomplete_type.pass.cpp b/test/std/containers/sequences/list/incomplete_type.pass.cpp
index adfb4d45fc81..aff8f0367893 100644
--- a/test/std/containers/sequences/list/incomplete_type.pass.cpp
+++ b/test/std/containers/sequences/list/incomplete_type.pass.cpp
@@ -9,7 +9,7 @@
// <list>
-// Check that std::list and it's iterators can be instantiated with an incomplete
+// Check that std::list and its iterators can be instantiated with an incomplete
// type.
#include <list>
diff --git a/test/std/containers/sequences/list/list.cons/assign_initializer_list.pass.cpp b/test/std/containers/sequences/list/list.cons/assign_initializer_list.pass.cpp
index 9b2c6d68cbe5..4704cf40aafa 100644
--- a/test/std/containers/sequences/list/list.cons/assign_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/assign_initializer_list.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <list>
// void assign(initializer_list<value_type> il);
@@ -18,7 +20,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
std::list<int> d;
d.assign({3, 4, 5, 6});
@@ -29,7 +30,6 @@ int main()
assert(*i++ == 5);
assert(*i++ == 6);
}
-#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> d;
d.assign({3, 4, 5, 6});
@@ -40,6 +40,4 @@ int main()
assert(*i++ == 5);
assert(*i++ == 6);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/list/list.cons/assign_move.pass.cpp b/test/std/containers/sequences/list/list.cons/assign_move.pass.cpp
index 2f863c6169fc..eec214205178 100644
--- a/test/std/containers/sequences/list/list.cons/assign_move.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/assign_move.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <list>
// list& operator=(list&& c);
@@ -19,7 +21,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::list<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
std::list<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
@@ -62,7 +63,6 @@ int main()
assert(l.empty());
assert(l2.get_allocator() == lo.get_allocator());
}
-#if TEST_STD_VER >= 11
{
std::list<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
std::list<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
@@ -77,6 +77,4 @@ int main()
assert(l.empty());
assert(l2.get_allocator() == lo.get_allocator());
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp b/test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp
index 6f76d8c56882..7f3114d6e1c4 100644
--- a/test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp
@@ -32,14 +32,16 @@ struct some_alloc
int main()
{
+#if defined(_LIBCPP_VERSION)
{
typedef std::list<MoveOnly> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
+ static_assert(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::list<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::list<MoveOnly, other_allocator<MoveOnly>> C;
static_assert(!std::is_nothrow_default_constructible<C>::value, "");
diff --git a/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp b/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp
index 66e40a30d1f1..b5ec50637ab8 100644
--- a/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp
@@ -42,8 +42,10 @@ int main()
typedef std::list<MoveOnly, other_allocator<MoveOnly>> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::list<MoveOnly, some_alloc<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/sequences/list/list.cons/initializer_list.pass.cpp b/test/std/containers/sequences/list/list.cons/initializer_list.pass.cpp
index 40413203bdfc..8f04e7342fc6 100644
--- a/test/std/containers/sequences/list/list.cons/initializer_list.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/initializer_list.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <list>
// list(initializer_list<value_type> il);
@@ -18,7 +20,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
std::list<int> d = {3, 4, 5, 6};
assert(d.size() == 4);
@@ -28,7 +29,6 @@ int main()
assert(*i++ == 5);
assert(*i++ == 6);
}
-#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> d = {3, 4, 5, 6};
assert(d.size() == 4);
@@ -38,6 +38,4 @@ int main()
assert(*i++ == 5);
assert(*i++ == 6);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp b/test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp
index 6040c648e547..3388e00dfb03 100644
--- a/test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <list>
// list(initializer_list<value_type> il, const Allocator& a = allocator_type());
@@ -19,7 +21,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
std::list<int, test_allocator<int>> d({3, 4, 5, 6}, test_allocator<int>(3));
assert(d.get_allocator() == test_allocator<int>(3));
@@ -30,7 +31,6 @@ int main()
assert(*i++ == 5);
assert(*i++ == 6);
}
-#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> d({3, 4, 5, 6}, min_allocator<int>());
assert(d.get_allocator() == min_allocator<int>());
@@ -41,6 +41,4 @@ int main()
assert(*i++ == 5);
assert(*i++ == 6);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/list/list.cons/move_alloc.pass.cpp b/test/std/containers/sequences/list/list.cons/move_alloc.pass.cpp
index 9f8a536b33c5..7236f7cc6ac2 100644
--- a/test/std/containers/sequences/list/list.cons/move_alloc.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/move_alloc.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <list>
// list(list&& c, const allocator_type& a);
@@ -19,7 +21,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::list<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
std::list<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
@@ -59,7 +60,6 @@ int main()
assert(!l.empty());
assert(l2.get_allocator() == other_allocator<MoveOnly>(4));
}
-#if TEST_STD_VER >= 11
{
std::list<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
std::list<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
@@ -73,6 +73,4 @@ int main()
assert(l.empty());
assert(l2.get_allocator() == min_allocator<MoveOnly>());
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp b/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp
index 81f78116af2e..0d3ccfa68c93 100644
--- a/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp
@@ -42,12 +42,14 @@ int main()
typedef std::list<MoveOnly, test_allocator<MoveOnly>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::list<MoveOnly, other_allocator<MoveOnly>> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_move_assignable<C>::value, "");
+ static_assert(std::is_nothrow_move_assignable<C>::value, "");
}
{
typedef std::list<MoveOnly, some_alloc<MoveOnly>> C;
- LIBCPP_STATIC_ASSERT(!std::is_nothrow_move_assignable<C>::value, "");
+ static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}
+#endif // _LIBCPP_VERSION
}
diff --git a/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp b/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp
index b40cb718a3f1..878dab66f0ad 100644
--- a/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp
@@ -32,18 +32,20 @@ struct some_alloc
int main()
{
+#if defined(_LIBCPP_VERSION)
{
typedef std::list<MoveOnly> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
+ static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::list<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::list<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::list<MoveOnly, some_alloc<MoveOnly>> C;
static_assert(!std::is_nothrow_move_constructible<C>::value, "");
diff --git a/test/std/containers/sequences/list/list.cons/op_equal_initializer_list.pass.cpp b/test/std/containers/sequences/list/list.cons/op_equal_initializer_list.pass.cpp
index 1097bdab2198..b638e219d9c8 100644
--- a/test/std/containers/sequences/list/list.cons/op_equal_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/op_equal_initializer_list.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <list>
// list& operator=(initializer_list<value_type> il);
@@ -17,7 +19,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
std::list<int> d;
d = {3, 4, 5, 6};
@@ -28,7 +29,6 @@ int main()
assert(*i++ == 5);
assert(*i++ == 6);
}
-#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> d;
d = {3, 4, 5, 6};
@@ -39,6 +39,4 @@ int main()
assert(*i++ == 5);
assert(*i++ == 6);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/list/list.cons/size_type.pass.cpp b/test/std/containers/sequences/list/list.cons/size_type.pass.cpp
index 95cdeb0c8539..cbe790c0f3bc 100644
--- a/test/std/containers/sequences/list/list.cons/size_type.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/size_type.pass.cpp
@@ -25,7 +25,6 @@ test3(unsigned n, Allocator const &alloc = Allocator())
{
#if TEST_STD_VER > 11
typedef std::list<T, Allocator> C;
- typedef typename C::const_iterator const_iterator;
{
C d(n, alloc);
assert(d.size() == n);
diff --git a/test/std/containers/sequences/list/list.modifiers/insert_iter_initializer_list.pass.cpp b/test/std/containers/sequences/list/list.modifiers/insert_iter_initializer_list.pass.cpp
index 91845e564b02..2d5231e78209 100644
--- a/test/std/containers/sequences/list/list.modifiers/insert_iter_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/insert_iter_initializer_list.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <list>
// iterator insert(const_iterator p, initializer_list<value_type> il);
@@ -18,7 +20,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
std::list<int> d(10, 1);
std::list<int>::iterator i = d.insert(next(d.cbegin(), 2), {3, 4, 5, 6});
@@ -40,7 +41,6 @@ int main()
assert(*i++ == 1);
assert(*i++ == 1);
}
-#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> d(10, 1);
std::list<int, min_allocator<int>>::iterator i = d.insert(next(d.cbegin(), 2), {3, 4, 5, 6});
@@ -62,6 +62,4 @@ int main()
assert(*i++ == 1);
assert(*i++ == 1);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/list/list.modifiers/push_back_rvalue.pass.cpp b/test/std/containers/sequences/list/list.modifiers/push_back_rvalue.pass.cpp
index 10acede511f4..3d9d00abe52f 100644
--- a/test/std/containers/sequences/list/list.modifiers/push_back_rvalue.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/push_back_rvalue.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <list>
// void push_back(value_type&& x);
@@ -19,7 +21,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::list<MoveOnly> l1;
l1.push_back(MoveOnly(1));
@@ -30,7 +31,6 @@ int main()
assert(l1.front() == MoveOnly(1));
assert(l1.back() == MoveOnly(2));
}
-#if TEST_STD_VER >= 11
{
std::list<MoveOnly, min_allocator<MoveOnly>> l1;
l1.push_back(MoveOnly(1));
@@ -41,6 +41,4 @@ int main()
assert(l1.front() == MoveOnly(1));
assert(l1.back() == MoveOnly(2));
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/list/list.modifiers/push_front_rvalue.pass.cpp b/test/std/containers/sequences/list/list.modifiers/push_front_rvalue.pass.cpp
index 5321ee0faed3..6fef6ade9c79 100644
--- a/test/std/containers/sequences/list/list.modifiers/push_front_rvalue.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/push_front_rvalue.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <list>
// void push_front(value_type&& x);
@@ -19,7 +21,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::list<MoveOnly> l1;
l1.push_front(MoveOnly(1));
@@ -30,7 +31,6 @@ int main()
assert(l1.front() == MoveOnly(2));
assert(l1.back() == MoveOnly(1));
}
-#if TEST_STD_VER >= 11
{
std::list<MoveOnly, min_allocator<MoveOnly>> l1;
l1.push_front(MoveOnly(1));
@@ -41,6 +41,4 @@ int main()
assert(l1.front() == MoveOnly(2));
assert(l1.back() == MoveOnly(1));
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp b/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp
index 512635359c5d..cfe1bfd2f411 100644
--- a/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp
@@ -59,14 +59,16 @@ int main()
typedef std::list<MoveOnly> C;
static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::list<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::list<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::list<MoveOnly, some_alloc<MoveOnly>> C;
#if TEST_STD_VER >= 14
diff --git a/test/std/containers/sequences/vector.bool/assign_initializer_list.pass.cpp b/test/std/containers/sequences/vector.bool/assign_initializer_list.pass.cpp
index ac7a2ce38adf..60146a88b3b5 100644
--- a/test/std/containers/sequences/vector.bool/assign_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/assign_initializer_list.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
// void assign(initializer_list<value_type> il);
@@ -18,7 +20,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
std::vector<bool> d;
d.assign({true, false, false, true});
@@ -28,7 +29,6 @@ int main()
assert(d[2] == false);
assert(d[3] == true);
}
-#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool>> d;
d.assign({true, false, false, true});
@@ -38,6 +38,4 @@ int main()
assert(d[2] == false);
assert(d[3] == true);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/vector.bool/assign_move.pass.cpp b/test/std/containers/sequences/vector.bool/assign_move.pass.cpp
index f07c1d90059d..13cd65f33123 100644
--- a/test/std/containers/sequences/vector.bool/assign_move.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/assign_move.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
// vector& operator=(vector&& c);
@@ -18,7 +20,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::vector<bool, test_allocator<bool> > l(test_allocator<bool>(5));
std::vector<bool, test_allocator<bool> > lo(test_allocator<bool>(5));
@@ -61,7 +62,6 @@ int main()
assert(l.empty());
assert(l2.get_allocator() == lo.get_allocator());
}
-#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool> > l(min_allocator<bool>{});
std::vector<bool, min_allocator<bool> > lo(min_allocator<bool>{});
@@ -76,6 +76,4 @@ int main()
assert(l.empty());
assert(l2.get_allocator() == lo.get_allocator());
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp b/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp
index 4f860dabac95..4e71df37421e 100644
--- a/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp
@@ -31,14 +31,16 @@ struct some_alloc
int main()
{
+#if defined(_LIBCPP_VERSION)
{
typedef std::vector<bool> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
+ static_assert(std::is_nothrow_default_constructible<C>::value, "");
}
{
typedef std::vector<bool, test_allocator<bool>> 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::vector<bool, other_allocator<bool>> C;
static_assert(!std::is_nothrow_default_constructible<C>::value, "");
diff --git a/test/std/containers/sequences/vector.bool/dtor_noexcept.pass.cpp b/test/std/containers/sequences/vector.bool/dtor_noexcept.pass.cpp
index b8ff33c5d2e8..5f1f5d10485d 100644
--- a/test/std/containers/sequences/vector.bool/dtor_noexcept.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/dtor_noexcept.pass.cpp
@@ -41,8 +41,10 @@ int main()
typedef std::vector<bool, other_allocator<bool>> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::vector<bool, some_alloc<bool>> 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/sequences/vector.bool/emplace.pass.cpp b/test/std/containers/sequences/vector.bool/emplace.pass.cpp
index ccdce913c73c..8a1ed033488a 100644
--- a/test/std/containers/sequences/vector.bool/emplace.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/emplace.pass.cpp
@@ -34,7 +34,7 @@ int main()
assert(c.front() == false);
assert(c.back() == true);
- i = c.emplace(c.cbegin()+1, 1 == 1);
+ i = c.emplace(c.cbegin()+1, true);
assert(i == c.begin()+1);
assert(c.size() == 3);
assert(c.front() == false);
@@ -56,7 +56,7 @@ int main()
assert(c.front() == false);
assert(c.back() == true);
- i = c.emplace(c.cbegin()+1, 1 == 1);
+ i = c.emplace(c.cbegin()+1, true);
assert(i == c.begin()+1);
assert(c.size() == 3);
assert(c.size() == 3);
diff --git a/test/std/containers/sequences/vector.bool/enabled_hash.pass.cpp b/test/std/containers/sequences/vector.bool/enabled_hash.pass.cpp
new file mode 100644
index 000000000000..f8a8dbd8d6d4
--- /dev/null
+++ b/test/std/containers/sequences/vector.bool/enabled_hash.pass.cpp
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <vector>
+
+// Test that <vector> provides all of the arithmetic, enum, and pointer
+// hash specializations.
+
+#include <vector>
+
+#include "poisoned_hash_helper.hpp"
+#include "min_allocator.h"
+
+int main() {
+ test_library_hash_specializations_available();
+ {
+ test_hash_enabled_for_type<std::vector<bool> >();
+ test_hash_enabled_for_type<std::vector<bool, min_allocator<bool>>>();
+ }
+}
diff --git a/test/std/containers/sequences/vector.bool/find.pass.cpp b/test/std/containers/sequences/vector.bool/find.pass.cpp
index ffe844e0079c..d5c3f458c634 100644
--- a/test/std/containers/sequences/vector.bool/find.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/find.pass.cpp
@@ -12,7 +12,7 @@
// std::find with vector<bool>::iterator
-// http://llvm.org/bugs/show_bug.cgi?id=16816
+// https://bugs.llvm.org/show_bug.cgi?id=16816
#include <vector>
#include <algorithm>
diff --git a/test/std/containers/sequences/vector.bool/initializer_list.pass.cpp b/test/std/containers/sequences/vector.bool/initializer_list.pass.cpp
index 07bae0eb7089..a850fa2f1cdd 100644
--- a/test/std/containers/sequences/vector.bool/initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/initializer_list.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
// vector(initializer_list<value_type> il);
@@ -18,7 +20,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
std::vector<bool> d = {true, false, false, true};
assert(d.size() == 4);
@@ -27,7 +28,6 @@ int main()
assert(d[2] == false);
assert(d[3] == true);
}
-#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool>> d = {true, false, false, true};
assert(d.size() == 4);
@@ -36,6 +36,4 @@ int main()
assert(d[2] == false);
assert(d[3] == true);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/vector.bool/initializer_list_alloc.pass.cpp b/test/std/containers/sequences/vector.bool/initializer_list_alloc.pass.cpp
index 5f7f5144f841..9a2df4290e77 100644
--- a/test/std/containers/sequences/vector.bool/initializer_list_alloc.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/initializer_list_alloc.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
// vector(initializer_list<value_type> il, const Allocator& a = allocator_type());
@@ -19,7 +21,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
std::vector<bool, test_allocator<bool>> d({true, false, false, true}, test_allocator<bool>(3));
assert(d.get_allocator() == test_allocator<bool>(3));
@@ -29,7 +30,6 @@ int main()
assert(d[2] == false);
assert(d[3] == true);
}
-#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool>> d({true, false, false, true}, min_allocator<bool>());
assert(d.get_allocator() == min_allocator<bool>());
@@ -39,6 +39,4 @@ int main()
assert(d[2] == false);
assert(d[3] == true);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/vector.bool/insert_iter_initializer_list.pass.cpp b/test/std/containers/sequences/vector.bool/insert_iter_initializer_list.pass.cpp
index 3a176d94e860..df4cb199b8fd 100644
--- a/test/std/containers/sequences/vector.bool/insert_iter_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/insert_iter_initializer_list.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
// iterator insert(const_iterator p, initializer_list<value_type> il);
@@ -18,7 +20,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
std::vector<bool> d(10, true);
std::vector<bool>::iterator i = d.insert(d.cbegin() + 2, {false, true, true, false});
@@ -39,7 +40,6 @@ int main()
assert(d[12] == true);
assert(d[13] == true);
}
-#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool>> d(10, true);
std::vector<bool, min_allocator<bool>>::iterator i = d.insert(d.cbegin() + 2, {false, true, true, false});
@@ -60,6 +60,4 @@ int main()
assert(d[12] == true);
assert(d[13] == true);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/vector.bool/move.pass.cpp b/test/std/containers/sequences/vector.bool/move.pass.cpp
index f3a11ec562c0..f189e2b97092 100644
--- a/test/std/containers/sequences/vector.bool/move.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/move.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
// vector(vector&& c);
@@ -18,7 +20,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::vector<bool, test_allocator<bool> > l(test_allocator<bool>(5));
std::vector<bool, test_allocator<bool> > lo(test_allocator<bool>(5));
@@ -45,7 +46,6 @@ int main()
assert(l.empty());
assert(l2.get_allocator() == lo.get_allocator());
}
-#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool> > l(min_allocator<bool>{});
std::vector<bool, min_allocator<bool> > lo(min_allocator<bool>{});
@@ -59,6 +59,4 @@ int main()
assert(l.empty());
assert(l2.get_allocator() == lo.get_allocator());
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/vector.bool/move_alloc.pass.cpp b/test/std/containers/sequences/vector.bool/move_alloc.pass.cpp
index 7aaa7c55550b..b3b6f964966b 100644
--- a/test/std/containers/sequences/vector.bool/move_alloc.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/move_alloc.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
// vector(vector&& c, const allocator_type& a);
@@ -18,7 +20,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::vector<bool, test_allocator<bool> > l(test_allocator<bool>(5));
std::vector<bool, test_allocator<bool> > lo(test_allocator<bool>(5));
@@ -58,7 +59,6 @@ int main()
assert(!l.empty());
assert(l2.get_allocator() == other_allocator<bool>(4));
}
-#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool> > l(min_allocator<bool>{});
std::vector<bool, min_allocator<bool> > lo(min_allocator<bool>{});
@@ -72,6 +72,4 @@ int main()
assert(l.empty());
assert(l2.get_allocator() == min_allocator<bool>());
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp b/test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp
index dd4bf9e01ea9..556b6e656439 100644
--- a/test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp
@@ -59,31 +59,40 @@ struct some_alloc3
int main()
{
+#if defined(_LIBCPP_VERSION)
{
typedef std::vector<bool> 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::vector<bool, test_allocator<bool>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::vector<bool, other_allocator<bool>> 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::vector<bool, some_alloc<bool>> C;
#if TEST_STD_VER > 14
- LIBCPP_STATIC_ASSERT( std::is_nothrow_move_assignable<C>::value, "");
+#if defined(_LIBCPP_VERSION)
+ typedef std::vector<bool, some_alloc<bool>> C;
+ static_assert( std::is_nothrow_move_assignable<C>::value, "");
+#endif // _LIBCPP_VERSION
#else
+ typedef std::vector<bool, some_alloc<bool>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
#endif
}
#if TEST_STD_VER > 14
+#if defined(_LIBCPP_VERSION)
{ // POCMA false, is_always_equal true
typedef std::vector<bool, some_alloc2<bool>> C;
- LIBCPP_STATIC_ASSERT( std::is_nothrow_move_assignable<C>::value, "");
+ static_assert( std::is_nothrow_move_assignable<C>::value, "");
}
+#endif // _LIBCPP_VERSION
{ // POCMA false, is_always_equal false
typedef std::vector<bool, some_alloc3<bool>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
diff --git a/test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp b/test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp
index 3305d95e1ab8..f104eb32e5f4 100644
--- a/test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp
@@ -31,24 +31,29 @@ struct some_alloc
int main()
{
+#if defined(_LIBCPP_VERSION)
{
typedef std::vector<bool> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
+ static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::vector<bool, test_allocator<bool>> C;
- LIBCPP_STATIC_ASSERT(std::is_nothrow_move_constructible<C>::value, "");
+ static_assert(std::is_nothrow_move_constructible<C>::value, "");
}
{
typedef std::vector<bool, other_allocator<bool>> 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::vector<bool, some_alloc<bool>> C;
// In C++17, move constructors for allocators are not allowed to throw
#if TEST_STD_VER > 14
- LIBCPP_STATIC_ASSERT( std::is_nothrow_move_constructible<C>::value, "");
+#if defined(_LIBCPP_VERSION)
+ typedef std::vector<bool, some_alloc<bool>> C;
+ static_assert( std::is_nothrow_move_constructible<C>::value, "");
+#endif // _LIBCPP_VERSION
#else
+ typedef std::vector<bool, some_alloc<bool>> C;
static_assert(!std::is_nothrow_move_constructible<C>::value, "");
#endif
}
diff --git a/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp b/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp
index 4b959cf00ad3..61874338d655 100644
--- a/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
// vector& operator=(initializer_list<value_type> il);
@@ -18,7 +20,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
std::vector<bool> d;
d = {true, false, false, true};
@@ -28,7 +29,6 @@ int main()
assert(d[2] == false);
assert(d[3] == true);
}
-#if TEST_STD_VER >= 11
{
std::vector<bool, min_allocator<bool>> d;
d = {true, false, false, true};
@@ -38,6 +38,4 @@ int main()
assert(d[2] == false);
assert(d[3] == true);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp b/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp
index 1b68eda2757b..d888af05f92f 100644
--- a/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp
@@ -55,32 +55,39 @@ struct some_alloc2
int main()
{
+#if defined(_LIBCPP_VERSION)
{
typedef std::vector<bool> C;
- LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
+ static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::vector<bool, test_allocator<bool>> C;
- LIBCPP_STATIC_ASSERT(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
+ static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
{
typedef std::vector<bool, other_allocator<bool>> 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::vector<bool, some_alloc<bool>> C;
#if TEST_STD_VER >= 14
+#if defined(_LIBCPP_VERSION)
// In c++14, if POCS is set, swapping the allocator is required not to throw
- LIBCPP_STATIC_ASSERT( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
+ typedef std::vector<bool, some_alloc<bool>> C;
+ static_assert( noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
+#endif // _LIBCPP_VERSION
#else
+ typedef std::vector<bool, some_alloc<bool>> C;
static_assert(!noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
#endif
}
#if TEST_STD_VER >= 14
+#if defined(_LIBCPP_VERSION)
{
typedef std::vector<bool, some_alloc2<bool>> C;
// if the allocators are always equal, then the swap can be noexcept
- 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/sequences/vector.bool/vector_bool.pass.cpp b/test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
index 4f82792fa1fd..64104a40ec74 100644
--- a/test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
@@ -31,7 +31,8 @@ int main()
typedef std::hash<T> H;
static_assert((std::is_same<H::argument_type, T>::value), "" );
static_assert((std::is_same<H::result_type, std::size_t>::value), "" );
-
+ ASSERT_NOEXCEPT(H()(T()));
+
bool ba[] = {true, false, true, true, false};
T vb(std::begin(ba), std::end(ba));
H h;
@@ -43,6 +44,7 @@ int main()
typedef std::hash<T> H;
static_assert((std::is_same<H::argument_type, T>::value), "" );
static_assert((std::is_same<H::result_type, std::size_t>::value), "" );
+ ASSERT_NOEXCEPT(H()(T()));
bool ba[] = {true, false, true, true, false};
T vb(std::begin(ba), std::end(ba));
H h;
diff --git a/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp b/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp
index 6409acaf65c1..273bdad9acdb 100644
--- a/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp
@@ -13,6 +13,8 @@
#include <vector>
#include <cassert>
+
+#include "test_macros.h"
#include "test_allocator.h"
#include "MoveOnly.h"
#include "min_allocator.h"
@@ -20,9 +22,8 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
- std::vector<MoveOnly> v(100);
+ std::vector<int> v(100);
v.resize(50);
assert(v.size() == 50);
assert(v.capacity() == 100);
@@ -34,7 +35,7 @@ int main()
}
{
// Add 1 for implementations that dynamically allocate a container proxy.
- std::vector<MoveOnly, limited_allocator<MoveOnly, 300 + 1> > v(100);
+ std::vector<int, limited_allocator<int, 300 + 1> > v(100);
v.resize(50);
assert(v.size() == 50);
assert(v.capacity() == 100);
@@ -44,9 +45,9 @@ int main()
assert(v.capacity() >= 200);
assert(is_contiguous_container_asan_correct(v));
}
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
- std::vector<int> v(100);
+ std::vector<MoveOnly> v(100);
v.resize(50);
assert(v.size() == 50);
assert(v.capacity() == 100);
@@ -58,7 +59,7 @@ int main()
}
{
// Add 1 for implementations that dynamically allocate a container proxy.
- std::vector<int, limited_allocator<int, 300 + 1> > v(100);
+ std::vector<MoveOnly, limited_allocator<MoveOnly, 300 + 1> > v(100);
v.resize(50);
assert(v.size() == 50);
assert(v.capacity() == 100);
@@ -68,8 +69,6 @@ int main()
assert(v.capacity() >= 200);
assert(is_contiguous_container_asan_correct(v));
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#if TEST_STD_VER >= 11
{
std::vector<MoveOnly, min_allocator<MoveOnly>> v(100);
v.resize(50);
diff --git a/test/std/containers/sequences/vector/vector.cons/assign_initializer_list.pass.cpp b/test/std/containers/sequences/vector/vector.cons/assign_initializer_list.pass.cpp
index 222fa9c78f92..853f75583ddc 100644
--- a/test/std/containers/sequences/vector/vector.cons/assign_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/assign_initializer_list.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
// void assign(initializer_list<value_type> il);
@@ -20,7 +22,6 @@
template <typename Vec>
void test ( Vec &v )
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
v.assign({3, 4, 5, 6});
assert(v.size() == 4);
assert(is_contiguous_container_asan_correct(v));
@@ -28,7 +29,6 @@ void test ( Vec &v )
assert(v[1] == 4);
assert(v[2] == 5);
assert(v[3] == 6);
-#endif
}
int main()
@@ -41,8 +41,6 @@ int main()
test(d1);
test(d2);
}
-
-#if TEST_STD_VER >= 11
{
typedef std::vector<int, min_allocator<int>> V;
V d1;
@@ -51,5 +49,4 @@ int main()
test(d1);
test(d2);
}
-#endif
}
diff --git a/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp b/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp
index acbee97bcd1c..c2b6b83784f2 100644
--- a/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
// vector& operator=(vector&& c);
@@ -20,7 +22,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::vector<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
std::vector<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
@@ -76,7 +77,6 @@ int main()
assert(l2.get_allocator() == lo.get_allocator());
assert(is_contiguous_container_asan_correct(l2));
}
-#if TEST_STD_VER >= 11
{
std::vector<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
std::vector<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
@@ -96,6 +96,4 @@ int main()
assert(l2.get_allocator() == lo.get_allocator());
assert(is_contiguous_container_asan_correct(l2));
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp b/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp
index 10a381f9c8cc..1720866940ed 100644
--- a/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp
@@ -42,8 +42,10 @@ int main()
typedef std::vector<MoveOnly, other_allocator<MoveOnly>> C;
static_assert(std::is_nothrow_destructible<C>::value, "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::vector<MoveOnly, some_alloc<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/sequences/vector/vector.cons/initializer_list.pass.cpp b/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp
index 408bcc3b1499..edbad8c0d95b 100644
--- a/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
// vector(initializer_list<value_type> il);
@@ -18,7 +20,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
std::vector<int> d = {3, 4, 5, 6};
assert(d.size() == 4);
@@ -28,7 +29,6 @@ int main()
assert(d[2] == 5);
assert(d[3] == 6);
}
-#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> d = {3, 4, 5, 6};
assert(d.size() == 4);
@@ -38,6 +38,4 @@ int main()
assert(d[2] == 5);
assert(d[3] == 6);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp b/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp
index f4c3b5c1e8e0..ac5d0178e73a 100644
--- a/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
// vector(initializer_list<value_type> il, const Allocator& a = allocator_type());
@@ -20,7 +22,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
std::vector<int, test_allocator<int>> d({3, 4, 5, 6}, test_allocator<int>(3));
assert(d.get_allocator() == test_allocator<int>(3));
@@ -31,7 +32,6 @@ int main()
assert(d[2] == 5);
assert(d[3] == 6);
}
-#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> d({3, 4, 5, 6}, min_allocator<int>());
assert(d.get_allocator() == min_allocator<int>());
@@ -42,6 +42,4 @@ int main()
assert(d[2] == 5);
assert(d[3] == 6);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/vector/vector.cons/move.pass.cpp b/test/std/containers/sequences/vector/vector.cons/move.pass.cpp
index d51b364f3ba0..cd50d5432349 100644
--- a/test/std/containers/sequences/vector/vector.cons/move.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/move.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
// vector(vector&& c);
@@ -20,7 +22,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::vector<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
std::vector<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
@@ -68,7 +69,6 @@ int main()
assert(*j == 3);
assert(is_contiguous_container_asan_correct(c2));
}
-#if TEST_STD_VER >= 11
{
std::vector<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
std::vector<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
@@ -98,6 +98,4 @@ int main()
assert(*j == 3);
assert(is_contiguous_container_asan_correct(c2));
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp b/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp
index fcdd35ae1157..767a0ce3dce9 100644
--- a/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
// vector(vector&& c, const allocator_type& a);
@@ -20,7 +22,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::vector<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
std::vector<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
@@ -75,7 +76,6 @@ int main()
assert(l2.get_allocator() == other_allocator<MoveOnly>(4));
assert(is_contiguous_container_asan_correct(l2));
}
-#if TEST_STD_VER >= 11
{
std::vector<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
std::vector<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
@@ -94,6 +94,4 @@ int main()
assert(l2.get_allocator() == min_allocator<MoveOnly>());
assert(is_contiguous_container_asan_correct(l2));
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/vector/vector.cons/op_equal_initializer_list.pass.cpp b/test/std/containers/sequences/vector/vector.cons/op_equal_initializer_list.pass.cpp
index 4e5a20413683..21dd5c384b58 100644
--- a/test/std/containers/sequences/vector/vector.cons/op_equal_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/op_equal_initializer_list.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
// vector& operator=(initializer_list<value_type> il);
@@ -19,7 +21,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
std::vector<int> d;
d = {3, 4, 5, 6};
@@ -30,7 +31,6 @@ int main()
assert(d[2] == 5);
assert(d[3] == 6);
}
-#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> d;
d = {3, 4, 5, 6};
@@ -41,6 +41,4 @@ int main()
assert(d[2] == 5);
assert(d[3] == 6);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/vector/vector.modifiers/clear.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/clear.pass.cpp
new file mode 100644
index 000000000000..5f053eb8565a
--- /dev/null
+++ b/test/std/containers/sequences/vector/vector.modifiers/clear.pass.cpp
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// void clear();
+
+#include <vector>
+#include <cassert>
+
+#include "min_allocator.h"
+#include "asan_testing.h"
+
+int main()
+{
+ {
+ int a[] = {1, 2, 3};
+ std::vector<int> c(a, a+3);
+ c.clear();
+ assert(c.empty());
+ LIBCPP_ASSERT(c.__invariants());
+ LIBCPP_ASSERT(is_contiguous_container_asan_correct(c));
+ }
+#if TEST_STD_VER >= 11
+ {
+ int a[] = {1, 2, 3};
+ std::vector<int, min_allocator<int>> c(a, a+3);
+ c.clear();
+ assert(c.empty());
+ LIBCPP_ASSERT(c.__invariants());
+ LIBCPP_ASSERT(is_contiguous_container_asan_correct(c));
+ }
+#endif
+}
diff --git a/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp
index 7e4aed8c1b5e..e5e0277fa37a 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
// template <class... Args> iterator emplace(const_iterator pos, Args&&... args);
@@ -19,7 +21,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
std::vector<int> v;
v.reserve(3);
@@ -38,7 +39,6 @@ int main()
assert(v[0] == 3);
assert(is_contiguous_container_asan_correct(v));
}
-#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> v;
v.reserve(3);
@@ -57,6 +57,4 @@ int main()
assert(v[0] == 3);
assert(is_contiguous_container_asan_correct(v));
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_initializer_list.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_initializer_list.pass.cpp
index b0fe123aac48..9072d427cab7 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_initializer_list.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
// iterator insert(const_iterator p, initializer_list<value_type> il);
@@ -19,7 +21,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
std::vector<int> d(10, 1);
std::vector<int>::iterator i = d.insert(d.cbegin() + 2, {3, 4, 5, 6});
@@ -41,7 +42,6 @@ int main()
assert(d[12] == 1);
assert(d[13] == 1);
}
-#if TEST_STD_VER >= 11
{
std::vector<int, min_allocator<int>> d(10, 1);
std::vector<int, min_allocator<int>>::iterator i = d.insert(d.cbegin() + 2, {3, 4, 5, 6});
@@ -63,6 +63,4 @@ int main()
assert(d[12] == 1);
assert(d[13] == 1);
}
-#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
diff --git a/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp
index f4a1f5d5f519..ac1fffd9d0d7 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <vector>
// void push_back(value_type&& x);
@@ -21,7 +23,6 @@
int main()
{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
{
std::vector<MoveOnly> c;
c.push_back(MoveOnly(0));
@@ -81,7 +82,6 @@ int main()
for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == MoveOnly(j));
}
-#if TEST_STD_VER >= 11
{
std::vector<MoveOnly, min_allocator<MoveOnly>> c;
c.push_back(MoveOnly(0));
@@ -110,6 +110,4 @@ int main()
for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
assert(c[j] == MoveOnly(j));
}
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
diff --git a/test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp b/test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp
index 214f9a577571..f92ab8a5c300 100644
--- a/test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp
@@ -60,10 +60,12 @@ int main()
typedef std::vector<MoveOnly> C;
static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
+#if defined(_LIBCPP_VERSION)
{
typedef std::vector<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&>())), "");
}
+#endif // _LIBCPP_VERSION
{
typedef std::vector<MoveOnly, other_allocator<MoveOnly>> C;
static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
diff --git a/test/std/containers/unord/unord.map/compare.pass.cpp b/test/std/containers/unord/unord.map/compare.pass.cpp
index ea6d02f5fcbc..cffc1dbd42c1 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/incomplete_type.pass.cpp b/test/std/containers/unord/unord.map/incomplete_type.pass.cpp
index d51b1d8d181f..9fc0fd471ef5 100644
--- a/test/std/containers/unord/unord.map/incomplete_type.pass.cpp
+++ b/test/std/containers/unord/unord.map/incomplete_type.pass.cpp
@@ -10,7 +10,7 @@
// <unordered_map>
-// Check that std::unordered_map and it's iterators can be instantiated with an incomplete
+// Check that std::unordered_map and its iterators can be instantiated with an incomplete
// type.
#include <unordered_map>
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 939e0bcd4e69..7ef7f47ff865 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 4fb10afd4e59..0fe98abe774d 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 c0dc71da45d8..4191102a85ab 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 c40173ede750..2eb8c946720f 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 f2c694e86f74..400e0283fef2 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 fc286ceec8eb..75807fa78889 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 4eea3d0f6fb5..5cb60f6a6d91 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/incomplete.pass.cpp b/test/std/containers/unord/unord.multimap/incomplete.pass.cpp
index 7822224e7366..67bff9419757 100644
--- a/test/std/containers/unord/unord.multimap/incomplete.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/incomplete.pass.cpp
@@ -10,7 +10,7 @@
// <unordered_map>
-// Check that std::unordered_multimap and it's iterators can be instantiated with an incomplete
+// Check that std::unordered_multimap and its iterators can be instantiated with an incomplete
// type.
#include <unordered_map>
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 9c42435946ff..ff3bc0105bd3 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 a2ab399d3469..3e9a10ab798a 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 b0b2b664f098..38c8285f5236 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 0f898f1b73e0..8c5ddab054e5 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 e404612a754e..d924ef15c1a3 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 b5f4403174b8..2fbe7a674273 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 b621449f2b74..2d5766946a6f 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 94067c3161e2..7f3a337bddc4 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 7a58709c9fc9..33d8e3c36361 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 06e6c65c991d..644af867dad4 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 ec4d0e675501..c60a811678fb 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/incomplete.pass.cpp b/test/std/containers/unord/unord.multiset/incomplete.pass.cpp
index f6d8dc17c5a2..1b3c1492c4a4 100644
--- a/test/std/containers/unord/unord.multiset/incomplete.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/incomplete.pass.cpp
@@ -11,7 +11,7 @@
// <unordered_set>
-// Check that std::unordered_multiset and it's iterators can be instantiated with an incomplete
+// Check that std::unordered_multiset and its iterators can be instantiated with an incomplete
// type.
#include <unordered_set>
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 fad1c182e6b7..df2cb7beff39 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 00fe962327f8..f7ebaaf65d47 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 c0c9e9021712..9ffe3ad480be 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 fba024aed00e..3b69c1eed2e3 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 62fe51e29903..1e927b9b3958 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 ac0a10a4b0ea..7336bb5afa7c 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 e44be18fa3b4..fcf2a5af3129 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 c221b6f2edb0..4afef42e6a60 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 d4efb6868026..ce290ff1c1e7 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 6f1f526abaf6..227d9e123331 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/incomplete.pass.cpp b/test/std/containers/unord/unord.set/incomplete.pass.cpp
index c970c1de5531..4f7a00c999e8 100644
--- a/test/std/containers/unord/unord.set/incomplete.pass.cpp
+++ b/test/std/containers/unord/unord.set/incomplete.pass.cpp
@@ -11,7 +11,7 @@
// <unordered_set>
-// Check that std::unordered_set and it's iterators can be instantiated with an incomplete
+// Check that std::unordered_set and its iterators can be instantiated with an incomplete
// type.
#include <unordered_set>
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 a342d472a3d5..94eb5d1bd04b 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 542788cca967..e9e04bca8562 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 ea88c53a526c..597662112cef 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 3dcc3247902e..b8d06dbfdd16 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 82e184b8d3ea..4c10ed2d6290 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 b89d68002477..670a3484d15f 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 7190a01208f0..43e06bd50463 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 4a16ddd3f4ce..7187f94a28dc 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 c2bd75960d5b..9ca2f80f0561 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);