Incorrectly triggers for template classes that inherit from a base class that has virtual destructor, as well as for forward declarations.
Any class inheriting from a base that has a virtual destructor will have their destructor also virtual, as per the Standard, so there's no need for them to explicitly declare it as virtual.
https://timsong-cpp.github.io/cppwp/n4140/class.dtor#9
If a class has a base class with a virtual destructor, its destructor (whether user- or implicitly-declared) is virtual.
Added unit test to prevent regression.
Fixes https://bugs.llvm.org/show_bug.cgi?id=51912
I'm confused as to why this is necessary -- this AST matcher calls through to CXXMethodDecl::isVirtual() which is different from isVirtualAsWritten() and should already account for inheriting the virtual specifier.