Diagnose the problem in templates in the context of the template
declaration instead of in the context of all of the (possibly very many)
template instantiations.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
What happens when TBase is an explicit specialization. In that situation a warning for the explicit specialization may be useful.
template <> struct TBase<float> { virtual void tfunt(T t); };
clang-tools-extra/test/clang-tidy/checkers/bugprone-virtual-near-miss.cpp | ||
---|---|---|
49 | Can this be left in to show no fix was applied. |
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.
clang-tools-extra/test/clang-tidy/checkers/bugprone-virtual-near-miss.cpp | ||
---|---|---|
49 | 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. |
Can you take a look at https://llvm.org/PR49330, I'm guessing this patch introduced this regression.
Can this be left in to show no fix was applied.