diff --git a/build/moz.configure/warnings.configure b/build/moz.configure/warnings.configure index f7a75648a3d3..f6a88e123bef 100755 --- a/build/moz.configure/warnings.configure +++ b/build/moz.configure/warnings.configure @@ -98,12 +98,6 @@ check_and_add_gcc_warning("-Wfloat-zero-conversion") # catches issues around loops check_and_add_gcc_warning("-Wloop-analysis") -# Clang < 10 doesn't play nice with "auto&&" and non-reference ranges. -check_and_add_gcc_warning( - "-Wno-range-loop-analysis", - when=depends(c_compiler)(lambda c: c.type == "clang" and c.version < "10.0"), -) - # catches C++ version forward-compat issues check_and_add_gcc_warning("-Wc++2a-compat", cxx_compiler) diff --git a/xpcom/string/nsReadableUtils.h b/xpcom/string/nsReadableUtils.h index 219b32d0eebd..060e982c77dc 100644 --- a/xpcom/string/nsReadableUtils.h +++ b/xpcom/string/nsReadableUtils.h @@ -452,6 +452,10 @@ void StringJoinAppend( nsTSubstring& aOutput, const nsTLiteralString& aSeparator, const InputRange& aInputRange, Func&& aFunc = mozilla::detail::kStringJoinAppendDefault) { +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wrange-loop-analysis" +#endif bool first = true; for (const auto& item : aInputRange) { if (first) { @@ -462,6 +466,9 @@ void StringJoinAppend( aFunc(aOutput, item); } +#ifdef __clang__ +# pragma clang diagnostic pop +#endif } /**