sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.
================
Comment at: clang-tools-extra/clangd/IncludeCleaner.cpp:76
bool VisitTemplateSpecializationType(TemplateSpecializationType *TST) {
+ if (const auto *UTN = TST->getTemplateName().getAsUsingTemplateName()) {
+ add(UTN->getFoundDecl());
----------------
hokein wrote:
> sammccall wrote:
> > TraverseTemplateSpecializationType calls TraverseTemplateName, isn't this
> > redundant with below?
> yeah, the `add(..FoundDecl)` is redundant, but the key point here we do an
> early return, which means we will not traverse the underlying template decl
> if this template decl is found via the using decl.
>
> I think this is a policy problem of whether we count the underlying decl as a
> reference for include-cleaner -- currently I just keep it consistent with the
> UsingType.
>
Makes sense.
But if we're creating a pseudo-`VisitTemplateName` by overriding its traverse
function, can we move the `add(getTemplateName() .getAsTemplateDecl())` logic
there too?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D123212/new/
https://reviews.llvm.org/D123212
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits