[PATCH] D72498: [clangd] Print underlying type for decltypes in hover

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 10 05:47:18 PST 2020


kadircet marked an inline comment as not done.
kadircet added a comment.

In D72498#1813899 <https://reviews.llvm.org/D72498#1813899>, @ilya-biryukov wrote:

> This does not work for more complicated types, though?
>  E.g. `decltype(a+b)* a` or `vector<decltype(a+b)> a`?


yes, and I think we should have a more sophisticated way to print composite types including decltypes to cover more cases.

> Why do we prefer to drop `decltype()`, yet show the typedefs? Both could lead to complicated types, arguably decltypes can be even worse than typedefs.
>  Could it be the case that we want to show the canonical types (i.e. without all syntax sugar)?
>  Maybe we want both the normal type and the canonical type?

I think typedef and decltype have different nature, the latter is a lot more obscure than the former, that was the reason why I handled decltypes specifically. 
I agree with your suggestion for typedefs though, I think there would be value in displaying the underlying type in hover card for type aliases to reduce navigation.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72498





More information about the cfe-commits mailing list