diff --git a/libcxx/test/libcxx/algorithms/debug_less.pass.cpp b/libcxx/test/libcxx/algorithms/debug_less.pass.cpp index 5d1b575b5129b6..6a05b8db67a8b1 100644 --- a/libcxx/test/libcxx/algorithms/debug_less.pass.cpp +++ b/libcxx/test/libcxx/algorithms/debug_less.pass.cpp @@ -183,6 +183,7 @@ inline bool operator<(FooImp const& x, Tag<0> y) { template inline bool operator<(Tag<0>, FooImp const&) { static_assert(sizeof(FooImp) != sizeof(FooImp), "should not be instantiated"); + return false; } template @@ -193,6 +194,7 @@ inline bool operator<(Tag<1> x, FooImp const& y) { template inline bool operator<(FooImp const&, Tag<1>) { static_assert(sizeof(FooImp) != sizeof(FooImp), "should not be instantiated"); + return false; } typedef FooImp<> Foo; diff --git a/libcxx/test/libcxx/atomics/libcpp-has-no-threads.pass.cpp b/libcxx/test/libcxx/atomics/libcpp-has-no-threads.pass.cpp index af2d55e1a4a3d7..b52ba642522310 100644 --- a/libcxx/test/libcxx/atomics/libcpp-has-no-threads.pass.cpp +++ b/libcxx/test/libcxx/atomics/libcpp-has-no-threads.pass.cpp @@ -8,7 +8,7 @@ // XFAIL: libcpp-has-no-threads #ifdef _LIBCPP_HAS_NO_THREADS -#error This should be XFAIL'd for the purpose of detecting that the LIT feature\ +#error This should be XFAILed for the purpose of detecting that the LIT feature\ 'libcpp-has-no-threads' is available iff _LIBCPP_HAS_NO_THREADS is defined #endif diff --git a/libcxx/test/libcxx/containers/associative/undef_min_max.pass.cpp b/libcxx/test/libcxx/containers/associative/undef_min_max.pass.cpp index 1408da97402957..ff15f355f82550 100644 --- a/libcxx/test/libcxx/containers/associative/undef_min_max.pass.cpp +++ b/libcxx/test/libcxx/containers/associative/undef_min_max.pass.cpp @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic ignored "-W#warnings" +#if defined(__clang__) +#pragma clang diagnostic ignored "-W#warnings" #endif #define min THIS IS A NASTY MACRO! diff --git a/libcxx/test/libcxx/containers/gnu_cxx/hash_map.pass.cpp b/libcxx/test/libcxx/containers/gnu_cxx/hash_map.pass.cpp index df413186959de0..ff268cd0c53c70 100644 --- a/libcxx/test/libcxx/containers/gnu_cxx/hash_map.pass.cpp +++ b/libcxx/test/libcxx/containers/gnu_cxx/hash_map.pass.cpp @@ -6,11 +6,13 @@ // //===----------------------------------------------------------------------===// - // Prevent emission of the deprecated warning. #ifdef __clang__ #pragma clang diagnostic ignored "-W#warnings" #endif +#ifdef __GNUC__ +#pragma GCC diagnostic ignored "-Wcpp" +#endif #include #include diff --git a/libcxx/test/libcxx/containers/gnu_cxx/hash_map_name_lookup.pass.cpp b/libcxx/test/libcxx/containers/gnu_cxx/hash_map_name_lookup.pass.cpp index bfcb8aeda3f93a..31e877eda82267 100644 --- a/libcxx/test/libcxx/containers/gnu_cxx/hash_map_name_lookup.pass.cpp +++ b/libcxx/test/libcxx/containers/gnu_cxx/hash_map_name_lookup.pass.cpp @@ -10,6 +10,9 @@ #ifdef __clang__ #pragma clang diagnostic ignored "-W#warnings" #endif +#ifdef __GNUC__ +#pragma GCC diagnostic push "-Wcpp" +#endif // Poison the std:: names we might use inside __gnu_cxx to ensure they're // properly qualified. diff --git a/libcxx/test/libcxx/containers/gnu_cxx/hash_set.pass.cpp b/libcxx/test/libcxx/containers/gnu_cxx/hash_set.pass.cpp index 307ba7368d162d..bfdbb38b2a891d 100644 --- a/libcxx/test/libcxx/containers/gnu_cxx/hash_set.pass.cpp +++ b/libcxx/test/libcxx/containers/gnu_cxx/hash_set.pass.cpp @@ -6,11 +6,13 @@ // //===----------------------------------------------------------------------===// - // Prevent emission of the deprecated warning. #ifdef __clang__ #pragma clang diagnostic ignored "-W#warnings" #endif +#ifdef __GNUC__ +#pragma GCC diagnostic ignored "-Wcpp" +#endif #include #include diff --git a/libcxx/test/libcxx/containers/gnu_cxx/hash_set_name_lookup.pass.cpp b/libcxx/test/libcxx/containers/gnu_cxx/hash_set_name_lookup.pass.cpp index b3e1e19566329c..6e50137ceb7163 100644 --- a/libcxx/test/libcxx/containers/gnu_cxx/hash_set_name_lookup.pass.cpp +++ b/libcxx/test/libcxx/containers/gnu_cxx/hash_set_name_lookup.pass.cpp @@ -10,6 +10,10 @@ #ifdef __clang__ #pragma clang diagnostic ignored "-W#warnings" #endif +#ifdef __GNUC__ +#pragma GCC diagnostic ignored "-Wcpp" +#endif + // Poison the std:: names we might use inside __gnu_cxx to ensure they're // properly qualified. struct allocator; diff --git a/libcxx/test/libcxx/numerics/c.math/undef_min_max.pass.cpp b/libcxx/test/libcxx/numerics/c.math/undef_min_max.pass.cpp index ba1696eb2405c9..a9f50171543b9d 100644 --- a/libcxx/test/libcxx/numerics/c.math/undef_min_max.pass.cpp +++ b/libcxx/test/libcxx/numerics/c.math/undef_min_max.pass.cpp @@ -5,8 +5,8 @@ // //===----------------------------------------------------------------------===// -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic ignored "-W#warnings" +#if defined(__clang__) +#pragma clang diagnostic ignored "-W#warnings" #endif #define min THIS IS A NASTY MACRO! diff --git a/libcxx/test/support/container_debug_tests.h b/libcxx/test/support/container_debug_tests.h index 36496c24e2bc34..e0b0df3b3b60ed 100644 --- a/libcxx/test/support/container_debug_tests.h +++ b/libcxx/test/support/container_debug_tests.h @@ -11,7 +11,7 @@ #include #ifndef _LIBCPP_VERSION -#error This header may only be used for libc++ tests" +#error This header may only be used for libc++ tests #endif #ifndef _LIBCPP_DEBUG diff --git a/libcxx/test/support/debug_mode_helper.h b/libcxx/test/support/debug_mode_helper.h index ed111ab127ce79..8256f3eb382830 100644 --- a/libcxx/test/support/debug_mode_helper.h +++ b/libcxx/test/support/debug_mode_helper.h @@ -287,6 +287,7 @@ inline bool ExpectDeath(const char* stmt, Func&& func, DebugInfoMatcher Matcher) case DeathTest::RK_MatchFailure: return OnFailure("matcher failed"); } + assert(false && "unreachable"); } template