[clang] [libcxx] [llvm] Add unnecessary-virtual-specifier to -Wextra (PR #138741)
Martin Storsjö via cfe-commits
cfe-commits at lists.llvm.org
Thu May 22 13:55:23 PDT 2025
================
@@ -882,6 +882,11 @@ if (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
# The LLVM libraries have no stable C++ API, so -Wnoexcept-type is not useful.
append("-Wno-noexcept-type" CMAKE_CXX_FLAGS)
+ # LLVM has a policy of including virtual "anchor" functions to control
+ # where the vtable is emitted. In `final` classes, these are exactly what
+ # this warning detects: unnecessary virtual methods.
+ add_flag_if_supported("-Wno-unnecessary-virtual-specifier" CXX_SUPPORTS_UNNECESSARY_VIRTUAL_FLAG)
----------------
mstorsjo wrote:
Ok, thanks, then I'll just wait for that one to settle instead of investing more time into this right now.
https://github.com/llvm/llvm-project/pull/138741
More information about the cfe-commits
mailing list