summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp')
-rw-r--r--libcxx/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/libcxx/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp
index 1b68eda2757..d888af05f92 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp
+++ b/libcxx/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
}
OpenPOWER on IntegriCloud