summaryrefslogtreecommitdiff
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 32d34d90d7f80..646c6be7da614 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 9d1c13d7b8e63..8c429cbd3c4b1 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 84c2451ce0872..6acf83129e12c 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 9a00829eadd63..f8fc21f1f2f52 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 817f1207ac949..e06410dcffa23 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 a0cf689ed9096..7f563b7cf635a 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 705fb580487b0..923a2124ece43 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 84f115f1958ef..b45e821ad0f9c 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 b5301418e85a3..84a9609742d3c 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 84907945a90ee..c1aa033845ece 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 c461eb38139d5..306f3d9761f17 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 6f97a5f3e7567..6020334ed26b8 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 669d23db57cdc..2486e8f243cf7 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 7637885c81e1e..549c1210b6f25 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 e42251527eb31..fdcdffbedb4bd 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 df46d376e0280..9e67f97f9ac07 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 f5295e52d1923..474b7b6ac59cc 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 8a650fa559759..28ff332542b43 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 05760dc0e7513..4f4b3884f28e4 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 ecc9c7ef5fd42..8148ea5b27ed6 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 0355e18f9f296..aecd77a18367d 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 15520e7834ff7..3156003232db0 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 b4b9d067704b1..096696fcd94cc 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 bae97cf4e48a9..18d64bc5f2c88 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 69759e03a28a1..eab1787ec8814 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 89fabef0a3a0a..9693ffb15903e 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 d3a1d6638d7ec..a200223051c82 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 6293c24a43d3f..d32cc3f48fef8 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 041f599c1f767..c91038e39040f 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 ce44b69fe3365..c07d4e6f9b881 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 9a7538ca31bd5..901fdbdb321ce 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 b3edd31f749b1..38b0ab8151aa0 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 c79feb93eb6ca..5dec2b910fb71 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 43045893fe075..781d740161287 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 c8becb3ca98a2..58c8f9ddfad19 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 2d1f9437fc45a..2e217c545f9cc 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 c34b7e07000e0..af6793f465a25 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 a833fdc047151..2fe5355124ae2 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 8e7ff6dff7028..efec4e403001b 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 239fda5c99d8f..68fc6cdc45435 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 6cb7941d92c5a..3a5b9ee9727d9 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 dea6492a515d8..fdb751da6aafa 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 30cca929da11f..e79e6eca3d95a 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 59955157421db..288810089e595 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 dbf27053a9f9f..dd70cda1845bf 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 9be3c63a6b312..2619569e154ea 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 68875139da1aa..6e935a52bb24c 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 4aa0fa6827e79..5a9a77c746fcb 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 ed8f1544bc8ff..8a65bc2d2e842 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 9b813ce342a3c..6ea72246fa058 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 e0669dc70ca9c..fdf67d23a12d9 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 597f642db3ce5..117e942895bad 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 64b3d811fdc9d..de7894234df33 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 5f7804023c7fe..6d33424fe4103 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 b5c881064a953..060d83b5e2543 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 8e734a639344f..df3d2d099c708 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 c0af762fb2777..0db30a0312829 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 d4dda02b84130..69fb6eb4ca4da 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 935284831d075..61118353dfb21 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 3d35916ccacb9..84f1eb9963fd7 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 0ec1f80562a8d..57f09d7cefebd 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 f70119e3c2afa..4d295d662da1a 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 ac73d142a67e6..7575c0e812423 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 844be20015dd2..cf9cbffa7304c 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 a5948b9ef7997..92a9e39fc94b1 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 6a1afe1334b03..5f5f5d0aef600 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 5f278e31c0dec..d4fe2591898a5 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 089f6d6807cbb..3390c331e00e2 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 2d963a1be4794..0000000000000
--- 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 b536ccf4910eb..061dd6da0785d 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 dd8ea88c2c1aa..8d7c4e9893a2f 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 15e1a08b08bf1..90ee0d2313ff3 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 2e21cc79d2699..173ccaa62d9f5 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 d831ceb289189..545b0e68a24bf 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 dfcd2cf90ebcd..7fc2b9d765676 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 65512e317cea0..397f209f72262 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 6e5cce39e67d2..ab6ae6bd327b0 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 c63194f7ee64f..d93c079e15edb 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 adfb4d45fc81d..aff8f03678938 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 9b2c6d68cbe54..4704cf40aafa0 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 2f863c6169fc6..eec214205178f 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 6f76d8c568826..7f3114d6e1c48 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 66e40a30d1f10..b5ec50637ab8c 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 40413203bdfc4..8f04e7342fc6e 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 6040c648e5479..3388e00dfb031 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 9f8a536b33c5a..7236f7cc6ac23 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 81f78116af2e9..0d3ccfa68c931 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 b40cb718a3f16..878dab66f0ad0 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 1097bdab21989..b638e219d9c87 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 95cdeb0c85393..cbe790c0f3bc5 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 91845e564b023..2d5231e782091 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 10acede511f4d..3d9d00abe52f5 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 5321ee0faed3e..6fef6ade9c79a 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 512635359c5d2..cfe1bfd2f411d 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 ac7a2ce38adfa..60146a88b3b5d 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 f07c1d90059dd..13cd65f33123a 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 4f860dabac952..4e71df37421eb 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 b8ff33c5d2e85..5f1f5d10485d7 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 ccdce913c73cd..8a1ed033488a3 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 0000000000000..f8a8dbd8d6d4b
--- /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 ffe844e0079c2..d5c3f458c6347 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 07bae0eb70897..a850fa2f1cdd2 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 5f7f5144f8413..9a2df4290e771 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 3a176d94e860e..df4cb199b8fd4 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 f3a11ec562c0d..f189e2b97092b 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 7aaa7c55550b2..b3b6f964966b5 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 dd4bf9e01ea9e..556b6e6564393 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 3305d95e1ab86..f104eb32e5f4d 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 4b959cf00ad34..61874338d6551 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 1b68eda2757bf..d888af05f92f1 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 4f82792fa1fde..64104a40ec743 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 6409acaf65c19..273bdad9acdb1 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 222fa9c78f921..853f75583ddc6 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 acbee97bcd1c5..c2b6b83784f24 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 10a381f9c8cc4..1720866940ede 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 408bcc3b14990..edbad8c0d95b7 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 f4c3b5c1e8e0a..ac5d0178e73a5 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 d51b364f3ba0b..cd50d54323490 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 fcdd35ae1157e..767a0ce3dce9a 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 4e5a204136839..21dd5c384b586 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 0000000000000..5f053eb8565a7
--- /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 7e4aed8c1b5e8..e5e0277fa37a6 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 b0fe123aac480..9072d427cab79 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 f4a1f5d5f519c..ac1fffd9d0d77 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 214f9a5775711..f92ab8a5c3005 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 ea6d02f5fcbc0..cffc1dbd42c12 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 d51b1d8d181f6..9fc0fd471ef5f 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 939e0bcd4e69a..7ef7f47ff865a 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 4fb10afd4e595..0fe98abe774dc 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 c0dc71da45d84..4191102a85abe 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 c40173ede7505..2eb8c946720f6 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 f2c694e86f74c..400e0283fef2d 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 fc286ceec8eb6..75807fa78889c 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 4eea3d0f6fb5e..5cb60f6a6d91d 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 7822224e7366d..67bff94197572 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 9c42435946ffa..ff3bc0105bd3b 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 a2ab399d34697..3e9a10ab798a1 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 b0b2b664f0988..38c8285f52363 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 0f898f1b73e01..8c5ddab054e57 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 e404612a754e2..d924ef15c1a3a 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 b5f4403174b89..2fbe7a6742731 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 b621449f2b740..2d5766946a6fe 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 94067c3161e24..7f3a337bddc4c 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 7a58709c9fc97..33d8e3c36361e 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 06e6c65c991d5..644af867dad49 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 ec4d0e675501e..c60a811678fbb 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 f6d8dc17c5a2e..1b3c1492c4a48 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 fad1c182e6b7f..df2cb7beff394 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 00fe962327f8a..f7ebaaf65d47b 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 c0c9e90217128..9ffe3ad480be5 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 fba024aed00ef..3b69c1eed2e38 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 62fe51e29903f..1e927b9b3958b 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 ac0a10a4b0ea1..7336bb5afa7c5 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 e44be18fa3b49..fcf2a5af31299 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 c221b6f2edb0e..4afef42e6a60e 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 d4efb68680266..ce290ff1c1e70 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 6f1f526abaf6e..227d9e1233312 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 c970c1de5531f..4f7a00c999e8a 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 a342d472a3d58..94eb5d1bd04be 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 542788cca9678..e9e04bca85622 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 ea88c53a526cb..597662112cefe 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 3dcc3247902ed..b8d06dbfdd161 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 82e184b8d3ea6..4c10ed2d6290b 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 b89d68002477a..670a3484d15fe 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 7190a01208f04..43e06bd50463a 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 4a16ddd3f4ce6..7187f94a28dc7 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 c2bd75960d5be..9ca2f80f05615 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);