From fa7aa68b13a10fd39d73535d1d9fbf846112e254 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Fri, 28 May 2021 13:15:26 -0700 Subject: [PATCH] Fix for error "'Run' overrides a member function but is not marked 'override' [-Werror,-Wsuggest-override]" occuring during windows debug self-build. --- lib/Testing/Support/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/Testing/Support/CMakeLists.txt b/lib/Testing/Support/CMakeLists.txt index bde4e1d64f1..1830ea88bb3 100644 --- a/lib/Testing/Support/CMakeLists.txt +++ b/lib/Testing/Support/CMakeLists.txt @@ -13,3 +13,12 @@ add_llvm_library(LLVMTestingSupport ) target_link_libraries(LLVMTestingSupport PRIVATE gtest) + +# This is to avoid the error in gtest-death-test-internal.h +# (150,16): error: 'Create' overrides a member function but +# is not marked 'override' [-Werror,-Wsuggest-override] +# during self-compile on Windows. + +if (HOST_WINNT AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" ) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-suggest-override") +endif()