[PATCH] D120258: [clangd] Add inlay hints for auto-typed parameters with one instantiation.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 23 09:09:42 PST 2022


sammccall added a comment.

(I think this patch is good to go now, ready for a stamp if anyone agrees :-)).

In D120258#3340619 <https://reviews.llvm.org/D120258#3340619>, @Trass3r wrote:

> Ah ok explicit instantiation made the difference:

Interesting! Looks like we're traversing the bodies of explicitly instantiated templates.
This violates our assumption we're only traversing explicitly written code (here the instantiation is explicit but the bodies are not!)
This feels like a RecursiveASTVisitor bug, but IDK if we'll be able to fix it or need to hack around it.

In any case it's not specific to this change:

  template <typename T> void foo() {
    auto x = T{}; // x: short: int
  }
  template void foo<int>();
  template void foo<short>();


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120258



More information about the cfe-commits mailing list