diff options
Diffstat (limited to 'test/std/containers/sequences')
28 files changed, 124 insertions, 63 deletions
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 30cca929d..e79e6eca3 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 599551574..288810089 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/move_assign_noexcept.pass.cpp b/test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp index 9b813ce34..6ea72246f 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 e0669dc70..fdf67d23a 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/size.pass.cpp b/test/std/containers/sequences/deque/deque.cons/size.pass.cpp index 64b3d811f..de7894234 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.special/swap_noexcept.pass.cpp b/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp index c0af762fb..0db30a031 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/default_noexcept.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp index 0ec1f8056..57f09d7ce 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 f70119e3c..4d295d662 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/move_alloc.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/move_alloc.pass.cpp index 6a1afe133..5f5f5d0ae 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 5f278e31c..d4fe25918 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 089f6d680..3390c331e 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.ops/sort.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.ops/sort.pass.cpp index 65512e317..397f209f7 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 6e5cce39e..ab6ae6bd3 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 c63194f7e..d93c079e1 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/list.cons/default_noexcept.pass.cpp b/test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp index 6f76d8c56..7f3114d6e 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 66e40a30d..b5ec50637 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/move_assign_noexcept.pass.cpp b/test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp index 81f78116a..0d3ccfa68 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 b40cb718a..878dab66f 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/size_type.pass.cpp b/test/std/containers/sequences/list/list.cons/size_type.pass.cpp index 95cdeb0c8..cbe790c0f 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.special/swap_noexcept.pass.cpp b/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp index 512635359..cfe1bfd2f 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/default_noexcept.pass.cpp b/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp index 4f860daba..4e71df374 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 b8ff33c5d..5f1f5d104 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/find.pass.cpp b/test/std/containers/sequences/vector.bool/find.pass.cpp index ffe844e00..d5c3f458c 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/move_assign_noexcept.pass.cpp b/test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp index dd4bf9e01..556b6e656 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 3305d95e1..f104eb32e 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/swap_noexcept.pass.cpp b/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp index 1b68eda27..d888af05f 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/vector.cons/dtor_noexcept.pass.cpp b/test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp index 10a381f9c..172086694 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.special/swap_noexcept.pass.cpp b/test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp index 214f9a577..f92ab8a5c 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&>())), ""); |