[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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294154 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Stephan T. Lavavej
2017-02-05 22:47:09 +00:00
parent 0becc206e3
commit 5597800045
69 changed files with 311 additions and 149 deletions

View File

@@ -59,10 +59,12 @@ int main()
typedef std::string C;
static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
}
#if defined(_LIBCPP_VERSION)
{
typedef std::basic_string<char, std::char_traits<char>, test_allocator<char>> 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::basic_string<char, std::char_traits<char>, some_alloc<char>> C;
#if TEST_STD_VER >= 14