[PATCH] D96224: [clang-itdy] Simplify virtual near-miss check

Stephen Kelly via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 20 12:49:59 PST 2021


steveire added a comment.

> What happens when TBase is an explicit specialization.

It's not changed before or after this patch. This check is documented as changing code based on the derived classes based on typos of methods overridden from the base.

Your suggestion makes sense to me, but it is orthogonal to this patch.



================
Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-virtual-near-miss.cpp:49
-  // CHECK-MESSAGES: :[[@LINE-3]]:3: warning: method 'TDerived<int>::tfunk' has {{.*}} 'TBase<int>::tfunc'
-  // CHECK-FIXES: virtual void tfunk(T t);
 };
----------------
njames93 wrote:
> Can this be left in to show no fix was applied.
After this patch it actually does apply the fixit. I can see why the fixit would have been skipped when it was based on the template instantiation (because a specialization could do unexpected things), but I don't see why it should be excluded when matching based on the template declaration.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96224/new/

https://reviews.llvm.org/D96224



More information about the cfe-commits mailing list