From dc1b8ca26ec88f392f61927b287dce00d4880d6e Mon Sep 17 00:00:00 2001 From: Fredrik Roubert Date: Wed, 4 Aug 2021 17:27:52 +0200 Subject: [PATCH] ICU-20973 Use the Clang -Wno-ambiguous-reversed-operator flag. --- icu4c/source/configure.ac | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/icu4c/source/configure.ac b/icu4c/source/configure.ac index 2331ac1ef6c..525dd126e9f 100644 --- a/icu4c/source/configure.ac +++ b/icu4c/source/configure.ac @@ -1317,6 +1317,16 @@ fi # Now that we're done using CPPFLAGS etc. for tests, we can change it # for build. +AC_LANG_PUSH([C++]) +# Silence a Clang warning about ambiguous operators with C++20 rewritten +# expressions that possibly or maybe even probably is a mistake (ICU-20973). +AX_CHECK_COMPILE_FLAG( + [-Wambiguous-reversed-operator], + [CXXFLAGS+=" -Wno-ambiguous-reversed-operator"], + [], + [-Werror]) +AC_LANG_POP([C++]) + if test "${CC}" = "clang"; then CLANGCFLAGS="-Qunused-arguments -Wno-parentheses-equality" else