[PATCH] D84213: [clang-tools-extra] Disable -Wsuggest-override for unittests/

Logan Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 20 21:16:38 PDT 2020


logan-5 created this revision.
logan-5 added reviewers: aaron.ballman, klimek, alexfh, juliehockett, sammccall.
logan-5 added a project: clang-tools-extra.
Herald added subscribers: cfe-commits, mgorny.
Herald added a project: clang.

I added `-Wsuggest-override` to the LLVM build earlier today, and have been putting out small fires I caused since then. One sticky area here has been directories that have files that include googlemock and/or googletest headers, which unfortunately do not themselves use `override`, so I've had to add `-Wno-suggest-override` to the CMakeLists.txt's in those directories. This patch adds this same flag to CMakeLists.txt in clang-tools-extra/unittests. I just wanted to get the LGTM from one or more of you fine folks before I committed it.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84213

Files:
  clang-tools-extra/unittests/CMakeLists.txt


Index: clang-tools-extra/unittests/CMakeLists.txt
===================================================================
--- clang-tools-extra/unittests/CMakeLists.txt
+++ clang-tools-extra/unittests/CMakeLists.txt
@@ -5,6 +5,10 @@
   add_unittest(ExtraToolsUnitTests ${test_dirname} ${ARGN})
 endfunction()
 
+if (CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG)
+  add_definitions("-Wno-suggest-override")
+endif()
+
 add_subdirectory(clang-apply-replacements)
 add_subdirectory(clang-change-namespace)
 add_subdirectory(clang-doc)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84213.279381.patch
Type: text/x-patch
Size: 518 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200721/1ada5b3e/attachment-0001.bin>


More information about the cfe-commits mailing list