================
@@ -689,7 +689,7 @@ if ( LLVM_COMPILER_IS_GCC_COMPATIBLE OR 
CMAKE_CXX_COMPILER_ID MATCHES "XL" )
 endif( LLVM_COMPILER_IS_GCC_COMPATIBLE OR CMAKE_CXX_COMPILER_ID MATCHES "XL" )
 
 if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-  append("-Werror=unguarded-availability-new" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+  append("-Werror=unguarded-availability-new 
-Wno-unnecessary-virtual-specifier" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
----------------
zmodem wrote:

I think the flag deserves a line of its own, along with a comment which 
explains that this is due to llvm's pattern of using anchor functions, which 
are exactly what the warning is targeting: unnecessary virtual functions.

I also wonder if we can pass the flag unconditionally like this, or if it will 
trigger `-Wunknown-warning-option` when building with an older clang. Maybe 
`-Wunknown-warning-option` is not enabled in llvm builds, in which case we're 
fine, otherwise maybe we need to do a version check here or something (see e.g. 
-Wno-class-memaccess or -Wc++98-compat-extra-semi in this file for inspiration).

https://github.com/llvm/llvm-project/pull/133265
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to