[PATCH] D93314: [clangd] go-to-definition on auto unwraps array/pointer types

Quentin Chateau via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 15 12:12:17 PST 2020


qchateau added a comment.

Ah good catch, I agree this is the behavior we want.

Concerning cases like `unique_ptr<T>`, the only generic behavior I can think of would be to suggest multiple `LocatedSymbol` when `auto` is deduced to a template class: the template class itself, and all its template type parameters.

  class A {};
  class B {};
  
  template<typename T, typename U>
  class C {};
  
  auto x = C<A, B>();

go-to-definition on `auto` could suggest jumping to `C`, `A` or `B`.

In a way, when you explicitly have `C<A, B> x;` you can go-to-def to either `A`, `B` or `C` in one click, it is simply made easier because all these types are visible in the code and you make the choice by choosing on where you click.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93314



More information about the cfe-commits mailing list