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

Nikita Popov llvmlistbot at llvm.org
Wed Sep 24 05:19:19 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)
----------------
nikic wrote:

Even if the warning itself can be improved (which I'm not the right person to comment on), we still need this workaround, right? I don't want to need to use Clang main to build MLIR. This is currently the only warning when building with Clang 20. It's quite annoying to have to change my `LLVM_ENABLE_WERROR` configuration and rebuild the world any time I need to touch MLIR for some reason.

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


More information about the Mlir-commits mailing list