diff --git a/mfbt/tests/TestUtf8.cpp b/mfbt/tests/TestUtf8.cpp index 03236abf0a60..29654c037fd3 100644 --- a/mfbt/tests/TestUtf8.cpp +++ b/mfbt/tests/TestUtf8.cpp @@ -21,7 +21,7 @@ using mozilla::IsValidUtf8; using mozilla::Utf8Unit; // Disable the C++ 2a warning. See bug #1509926 -#if defined(__clang__) +#if defined(__clang__) && (__clang_major__ >= 6) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wc++2a-compat" #endif @@ -742,6 +742,6 @@ int main() { return 0; } -#if defined(__clang__) +#if defined(__clang__) && (__clang_major__ >= 6) #pragma clang diagnostic pop #endif diff --git a/xpcom/tests/gtest/TestStrings.cpp b/xpcom/tests/gtest/TestStrings.cpp index bf23a6fa640c..ea49dd3cb6f2 100644 --- a/xpcom/tests/gtest/TestStrings.cpp +++ b/xpcom/tests/gtest/TestStrings.cpp @@ -30,7 +30,7 @@ }); // Disable the C++ 2a warning. See bug #1509926 -#if defined(__clang__) +#if defined(__clang__) && (__clang_major__ >= 6) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wc++2a-compat" #endif @@ -2345,6 +2345,6 @@ CONVERSION_BENCH(PerfUTF8toUTF16VIThousand, CopyUTF8toUTF16, mViThousandUtf8, } // namespace TestStrings -#if defined(__clang__) +#if defined(__clang__) && (__clang_major__ >= 6) #pragma clang diagnostic pop #endif