[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 07:01:05 PST 2022


sammccall added a comment.

In D120258#3340357 <https://reviews.llvm.org/D120258#3340357>, @sammccall wrote:

>> And I've even seen this:
>> F22205415: grafik.png <https://reviews.llvm.org/F22205415>
>> With a lambda in a versioned method like
>>
>>   template <Version V> void Foo<V>::foo()
>
> OK, this is scary... this is multiple hints at the same point right?

I haven't been able to reproduce this.

I tried:

  template <int> class Foo { void foo(); };
  
  template <int X>
  void Foo<X>::foo() {
      auto m = [this](auto x) {};
      m(42);
  }
  
  Foo<0> a;
  // Foo<1> b;

And I get no hints at all. (Presumably because we only traverse the primary template of `foo`, and Foo<X>::foo()::m::operator() is never instantiated, only Foo<0>::foo()::m::operator() is (with `int`).


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