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/multimap/multimap.special/swap_noexcept.pass.cpp | |
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/multimap/multimap.special/swap_noexcept.pass.cpp')
-rw-r--r-- | libcxx/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
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 } |