diff options
author | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2017-02-05 22:47:09 +0000 |
---|---|---|
committer | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2017-02-05 22:47:09 +0000 |
commit | 03fe6e2da23ed6e8317bda3b81d0ac3bb36009b3 (patch) | |
tree | 52c6a892068411ceff8d4736eb40dcaa8a60c324 /libcxx/test/std/containers/associative | |
parent | 8eb1f315ac2e137374632ab10c5832ed4cf60910 (diff) | |
download | bcm5719-llvm-03fe6e2da23ed6e8317bda3b81d0ac3bb36009b3.tar.gz bcm5719-llvm-03fe6e2da23ed6e8317bda3b81d0ac3bb36009b3.zip |
[libcxx] [test] Fix Clang -Wunused-local-typedef, part 1/3.
Guard typedefs and static_asserts with _LIBCPP_VERSION.
test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp
test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp
test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp
Additionally deal with conditional compilation.
test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp
test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp
Additionally deal with typedefs used by other typedefs.
Fixes D29135.
llvm-svn: 294154
Diffstat (limited to 'libcxx/test/std/containers/associative')
20 files changed, 88 insertions, 44 deletions
diff --git a/libcxx/test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp b/libcxx/test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp index 817f1207ac9..e06410dcffa 100644 --- a/libcxx/test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp +++ b/libcxx/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/libcxx/test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp index a0cf689ed90..7f563b7cf63 100644 --- a/libcxx/test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp +++ b/libcxx/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/libcxx/test/std/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp b/libcxx/test/std/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp index 84f115f1958..b45e821ad0f 100644 --- a/libcxx/test/std/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp +++ b/libcxx/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/libcxx/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp b/libcxx/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp index b5301418e85..84a9609742d 100644 --- a/libcxx/test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp +++ b/libcxx/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/libcxx/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp b/libcxx/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp index 84907945a90..c1aa033845e 100644 --- a/libcxx/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp +++ b/libcxx/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/libcxx/test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp b/libcxx/test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp index 6f97a5f3e75..6020334ed26 100644 --- a/libcxx/test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp +++ b/libcxx/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/libcxx/test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp index 669d23db57c..2486e8f243c 100644 --- a/libcxx/test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp +++ b/libcxx/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/libcxx/test/std/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp b/libcxx/test/std/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp index 7637885c81e..549c1210b6f 100644 --- a/libcxx/test/std/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp +++ b/libcxx/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/libcxx/test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp b/libcxx/test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp index e42251527eb..fdcdffbedb4 100644 --- a/libcxx/test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp +++ b/libcxx/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/libcxx/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp b/libcxx/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp index ecc9c7ef5fd..8148ea5b27e 100644 --- a/libcxx/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp +++ b/libcxx/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/libcxx/test/std/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp b/libcxx/test/std/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp index 15520e7834f..3156003232d 100644 --- a/libcxx/test/std/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp +++ b/libcxx/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/libcxx/test/std/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp index b4b9d067704..096696fcd94 100644 --- a/libcxx/test/std/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp +++ b/libcxx/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/libcxx/test/std/containers/associative/multiset/multiset.cons/move_assign_noexcept.pass.cpp b/libcxx/test/std/containers/associative/multiset/multiset.cons/move_assign_noexcept.pass.cpp index bae97cf4e48..18d64bc5f2c 100644 --- a/libcxx/test/std/containers/associative/multiset/multiset.cons/move_assign_noexcept.pass.cpp +++ b/libcxx/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/libcxx/test/std/containers/associative/multiset/multiset.cons/move_noexcept.pass.cpp b/libcxx/test/std/containers/associative/multiset/multiset.cons/move_noexcept.pass.cpp index 69759e03a28..eab1787ec88 100644 --- a/libcxx/test/std/containers/associative/multiset/multiset.cons/move_noexcept.pass.cpp +++ b/libcxx/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/libcxx/test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp b/libcxx/test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp index 89fabef0a3a..9693ffb1590 100644 --- a/libcxx/test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp +++ b/libcxx/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/libcxx/test/std/containers/associative/set/set.cons/default_noexcept.pass.cpp b/libcxx/test/std/containers/associative/set/set.cons/default_noexcept.pass.cpp index 6293c24a43d..d32cc3f48fe 100644 --- a/libcxx/test/std/containers/associative/set/set.cons/default_noexcept.pass.cpp +++ b/libcxx/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/libcxx/test/std/containers/associative/set/set.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/containers/associative/set/set.cons/dtor_noexcept.pass.cpp index 041f599c1f7..c91038e3904 100644 --- a/libcxx/test/std/containers/associative/set/set.cons/dtor_noexcept.pass.cpp +++ b/libcxx/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/libcxx/test/std/containers/associative/set/set.cons/move_assign_noexcept.pass.cpp b/libcxx/test/std/containers/associative/set/set.cons/move_assign_noexcept.pass.cpp index ce44b69fe33..c07d4e6f9b8 100644 --- a/libcxx/test/std/containers/associative/set/set.cons/move_assign_noexcept.pass.cpp +++ b/libcxx/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/libcxx/test/std/containers/associative/set/set.cons/move_noexcept.pass.cpp b/libcxx/test/std/containers/associative/set/set.cons/move_noexcept.pass.cpp index 9a7538ca31b..901fdbdb321 100644 --- a/libcxx/test/std/containers/associative/set/set.cons/move_noexcept.pass.cpp +++ b/libcxx/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/libcxx/test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp b/libcxx/test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp index b3edd31f749..38b0ab8151a 100644 --- a/libcxx/test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp +++ b/libcxx/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 } |