[PATCH] D101529: Fix `-Wsuggest-override` warning when building benchmark with clang-cl on Windows
Sibi Siddharthan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 29 06:11:39 PDT 2021
SibiSiddharthan created this revision.
SibiSiddharthan added reviewers: kbobyrev, logan-5.
Herald added subscribers: lebedev.ri, mgorny.
Herald added a reviewer: lebedev.ri.
SibiSiddharthan requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This patch adds '-Wno-suggest-override' flag to clang-cl.
Currently this flag gets added in the else() block for compilers
other than MSVC. Since CMake evaluates `if(MSVC)` true for clang-cl
this flag does not get added.
Let me know if it would be better if we move the
`if(CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG)` block outside `if(MSVC)`.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D101529
Files:
llvm/utils/benchmark/CMakeLists.txt
Index: llvm/utils/benchmark/CMakeLists.txt
===================================================================
--- llvm/utils/benchmark/CMakeLists.txt
+++ llvm/utils/benchmark/CMakeLists.txt
@@ -130,6 +130,13 @@
set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL} /LTCG")
set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} /LTCG")
endif()
+
+ # Turn off this warning for clang-cl builds
+ if(CLANG_CL)
+ if (CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG)
+ add_cxx_compiler_flag(-Wno-suggest-override)
+ endif()
+ endif()
else()
# Try and enable C++11. Don't use C++14 because it doesn't work in some
# configurations.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101529.341490.patch
Type: text/x-patch
Size: 697 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210429/74d09f0c/attachment.bin>
More information about the llvm-commits
mailing list