[clang-tools-extra] Disable -Wsuggest-override for unittests/
authorLogan Smith <logan.r.smith0@gmail.com>
Tue, 21 Jul 2020 16:11:53 +0000 (09:11 -0700)
committerLogan Smith <logan.r.smith0@gmail.com>
Tue, 21 Jul 2020 16:11:53 +0000 (09:11 -0700)
This avoids massive warning spam due to the unit tests' use of gtest and gmock, which do not use the 'override' keyword in their sources.

Differential Revision: https://reviews.llvm.org/D84213

clang-tools-extra/unittests/CMakeLists.txt

index 086a68e..751827c 100644 (file)
@@ -5,6 +5,10 @@ function(add_extra_unittest test_dirname)
   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)