Adding Wunused-lambda-capture to Clang build flags (#85655)

Add `-Wunused-lambda-capture` to clang build flags to better align internal and OSS build systems. This flag is not supported in gcc so only adding for clang builds.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/85655
Approved by: https://github.com/huydhn
This commit is contained in:
Omkar Salpekar 2022-09-27 18:11:18 +00:00 committed by PyTorch MergeBot
parent d51f6de9b8
commit f4251525de

View File

@ -893,6 +893,7 @@ if(NOT MSVC)
append_cxx_flag_if_supported("-Wno-c++14-extensions" CMAKE_CXX_FLAGS)
append_cxx_flag_if_supported("-Wno-constexpr-not-const" CMAKE_CXX_FLAGS)
append_cxx_flag_if_supported("-Wno-missing-braces" CMAKE_CXX_FLAGS)
append_cxx_flag_if_supported("-Wunused-lambda-capture" CMAKE_CXX_FLAGS)
append_cxx_flag_if_supported("-Qunused-arguments" CMAKE_CXX_FLAGS)
if(${USE_COLORIZE_OUTPUT})
endif()