[Mlir-commits] [mlir] [MLIR][CMake] Suppress -Wpass-failed warning (PR #160472)
Mehdi Amini
llvmlistbot at llvm.org
Wed Sep 24 05:36:33 PDT 2025
================
@@ -110,6 +110,12 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
endif()
endif()
+# libstdc++15 makes use of an unroll pragma inside std::find_if(). This
+# produces a warning if clang fails to unroll the loop. As this pragma is
+# outside of our control, suppress the warning.
+check_cxx_compiler_flag("-Wno-pass-failed" CXX_SUPPORTS_WNO_PASS_FAILED)
+append_if(CXX_SUPPORTS_WNO_PASS_FAILED "-Wno-pass-failed" CMAKE_CXX_FLAGS)
----------------
joker-eph wrote:
Sure, but it should be as narrow as possible. For example can we know in CMake what is the libstdc++ version?
Disabling gcc warnings is fairly common, but we dogfood clang warnings and I don't expect us to ever have to disable a clang warning unconditionally, instead I would think that it would get disabled for clang<20 **and** we also remove the warning from clang 21.
https://github.com/llvm/llvm-project/pull/160472
More information about the Mlir-commits
mailing list