From 687ccba198301bd5998ea0307de23e9a662506aa Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Fri, 6 May 2022 11:02:17 -0400 Subject: [PATCH] [libc++][NFC] Move swap_noexcept test to .compile.pass.cpp --- .../{swap_noexcept.pass.cpp => swap_noexcept.compile.pass.cpp} | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) rename libcxx/test/std/containers/sequences/vector/vector.special/{swap_noexcept.pass.cpp => swap_noexcept.compile.pass.cpp} (91%) diff --git a/libcxx/test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.special/swap_noexcept.compile.pass.cpp similarity index 91% rename from libcxx/test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp rename to libcxx/test/std/containers/sequences/vector/vector.special/swap_noexcept.compile.pass.cpp index bea7339..830d05c 100644 --- a/libcxx/test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.special/swap_noexcept.compile.pass.cpp @@ -55,7 +55,7 @@ struct some_alloc2 typedef std::true_type is_always_equal; }; -int main(int, char**) +void test() { { typedef std::vector C; @@ -66,7 +66,7 @@ int main(int, char**) typedef std::vector> C; static_assert(noexcept(swap(std::declval(), std::declval())), ""); } -#endif // _LIBCPP_VERSION +#endif { typedef std::vector> C; static_assert(noexcept(swap(std::declval(), std::declval())), ""); @@ -74,7 +74,7 @@ int main(int, char**) { typedef std::vector> C; #if TEST_STD_VER >= 14 - // In C++14, if POCS is set, swapping the allocator is required not to throw + // In C++14, if POCS is set, swapping the allocator is required not to throw static_assert( noexcept(swap(std::declval(), std::declval())), ""); #else static_assert(!noexcept(swap(std::declval(), std::declval())), ""); @@ -83,10 +83,8 @@ int main(int, char**) #if TEST_STD_VER >= 14 { typedef std::vector> C; - // if the allocators are always equal, then the swap can be noexcept + // If the allocators are always equal, then the swap can be noexcept static_assert( noexcept(swap(std::declval(), std::declval())), ""); } #endif - - return 0; } -- 2.7.4