Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions llvm/cmake/modules/HandleLLVMOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,15 @@ if (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
# Enable -Wstring-conversion to catch misuse of string literals.
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
append("-Wstring-conversion" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)

# Disable -Wno-pass-failed flag, which reports failure to perform
# optimizations suggested by pragmas. This warning is not relevant for LLVM
# projects and may be injected by pragmas in libstdc++.
# FIXME: Reconsider this choice if warnings from STL headers can be reliably
# avoided (https://github.com/llvm/llvm-project/issues/157666).
# This option has been available since Clang 3.5, and we do require a newer
# version.
append("-Wno-pass-failed" CMAKE_CXX_FLAGS)
endif()

if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
Expand All @@ -962,13 +971,6 @@ if (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))

# Enable -Wctad-maybe-unsupported to catch unintended use of CTAD.
add_flag_if_supported("-Wctad-maybe-unsupported" CTAD_MAYBE_UNSPPORTED_FLAG)

# Disable -Wno-pass-failed flag, which reports failure to perform
# optimizations suggested by pragmas. This warning is not relevant for LLVM
# projects and may be injected by pragmas in libstdc++.
# FIXME: Reconsider this choice if warnings from STL headers can be reliably
# avoided (https://github.com/llvm/llvm-project/issues/157666).
add_flag_if_supported("-Wno-pass-failed" NO_PASS_FAILED_FLAG)
endif (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))

if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT LLVM_ENABLE_WARNINGS)
Expand Down