From 0eb6bb8d2dfe2d8539f681eea4488396f01da850 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Sun, 5 Feb 2017 22:47:54 +0000 Subject: [PATCH] [libcxx] [test] Fix Clang -Wunused-local-typedef, part 3/3. test/std/strings/string.classes/typedefs.pass.cpp Actually test what basic_string's typedefs stand for. test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp NotDerived and ND were completely unused. test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp P2 was mistakenly not being used. Yes, that's right: -Wunused-local-typedef CAUGHT A MISTAKE! AMAZING! Fixes D29137. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294156 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/std/strings/string.classes/typedefs.pass.cpp | 9 +++++---- .../meta.trans/meta.trans.other/result_of11.pass.cpp | 2 -- .../utilities/utility/pairs/pairs.pair/default.pass.cpp | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/test/std/strings/string.classes/typedefs.pass.cpp b/test/std/strings/string.classes/typedefs.pass.cpp index 11ee6c8a1..3aba1c3f1 100644 --- a/test/std/strings/string.classes/typedefs.pass.cpp +++ b/test/std/strings/string.classes/typedefs.pass.cpp @@ -18,13 +18,14 @@ // typedef basic_string wstring; #include +#include int main() { - typedef std::string test1; - typedef std::wstring test2; + static_assert((std::is_same >::value), ""); + static_assert((std::is_same >::value), ""); #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS - typedef std::u16string test3; - typedef std::u32string test4; + static_assert((std::is_same >::value), ""); + static_assert((std::is_same >::value), ""); #endif // _LIBCPP_HAS_NO_UNICODE_CHARS } diff --git a/test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp index 8cb5853bb..eac4e4a08 100644 --- a/test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp +++ b/test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp @@ -26,7 +26,6 @@ struct wat struct F {}; struct FD : public F {}; -struct NotDerived {}; template void test_result_of_imp() @@ -43,7 +42,6 @@ void test_result_of_imp() int main() { - typedef NotDerived ND; { typedef char F::*PMD; test_result_of_imp(); diff --git a/test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp index c936daf25..af91abe74 100644 --- a/test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp +++ b/test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp @@ -49,7 +49,7 @@ int main() using P = std::pair; static_assert(!std::is_default_constructible

::value, ""); using P2 = std::pair; - static_assert(!std::is_default_constructible

::value, ""); + static_assert(!std::is_default_constructible::value, ""); } #endif }