Skip to content

Commit 1ab69d7

Browse files
authored
[CMake] Suppress -Wpass-failed warning (#160472)
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. Missed transforms are not something we care about in this context. Related to #157666.
1 parent 772071b commit 1ab69d7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

llvm/cmake/modules/HandleLLVMOptions.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,13 @@ if (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
962962

963963
# Enable -Wctad-maybe-unsupported to catch unintended use of CTAD.
964964
add_flag_if_supported("-Wctad-maybe-unsupported" CTAD_MAYBE_UNSPPORTED_FLAG)
965+
966+
# Disable -Wno-pass-failed flag, which reports failure to perform
967+
# optimizations suggested by pragmas. This warning is not relevant for LLVM
968+
# projects and may be injected by pragmas in libstdc++.
969+
# FIXME: Reconsider this choice if warnings from STL headers can be reliably
970+
# avoided (https://github.com/llvm/llvm-project/issues/157666).
971+
add_flag_if_supported("-Wno-pass-failed" NO_PASS_FAILED_FLAG)
965972
endif (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
966973

967974
if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT LLVM_ENABLE_WARNINGS)

0 commit comments

Comments
 (0)