[clang] [llvm] Enable unnecessary-virtual-specifier by default (PR #133265)

via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 27 11:16:33 PDT 2025


https://github.com/Sirraide commented:

Looks like you’ll have to update some tests because CI is failing (also, I’d be very surprised if we didn’t have tests for this). Also, this still needs a release note.

Maybe a fix for the virtual anchor pattern would be to somehow not emit the warning for the first virtual function in a class, but that feels like too much of a hack...

As to *whether* this should be enabled by default, I don’t really have strong opinions on that. It does seem like you’d usually not want to introduce new virtual functions in a `final` class; the anchor is really the only use case I can think of.

https://github.com/llvm/llvm-project/pull/133265


More information about the llvm-commits mailing list