Skip to content

Commit f02e074

Browse files
committed
Make sure -Wnon-virtual-dtor is passed only when compiling with Clang
Another follow-up for #92953. Addresses buildbot failure https://lab.llvm.org/buildbot/#/builders/193/builds/52421
1 parent 21f3a60 commit f02e074

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/cmake/modules/HandleLLVMOptions.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,9 @@ if (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
856856
# The LLVM libraries have no stable C++ API, so -Wnoexcept-type is not useful.
857857
append("-Wno-noexcept-type" CMAKE_CXX_FLAGS)
858858

859-
append("-Wnon-virtual-dtor" CMAKE_CXX_FLAGS)
859+
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
860+
append("-Wnon-virtual-dtor" CMAKE_CXX_FLAGS)
861+
endif()
860862
append("-Wdelete-non-virtual-dtor" CMAKE_CXX_FLAGS)
861863

862864
# Enable -Wsuggest-override if it's available, and only if it doesn't

0 commit comments

Comments
 (0)