[Mlir-commits] [mlir] [MLIR][CMake] Suppress -Wpass-failed warning (PR #160472)

Mehdi Amini llvmlistbot at llvm.org
Wed Sep 24 04:55:37 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:

It's not clear to me why is this the right fix.
This seems like a workaround for a specific version of the toolchain, but  doesn't this point out to a problem with the warning itself? 
Either the warning should be opt-in, or it should be able to maybe not hit on system headers (which I don't see how do implement in a robust way)?



https://github.com/llvm/llvm-project/pull/160472


More information about the Mlir-commits mailing list