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

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


sammccall added a comment.

Yeah we discussed that case offline and I should have mentioned.
Resolving this in places other than the top-level would be nice and probably worthy of a comment at least. But this special case seems common enough to be worth having.
The only place fully resolving could reasonably be done I guess is TypePrinter, because we can't actually transform the types into the correct form IIUC.
It's particularly unclear to me why typeprinter descends into auto but prints decltype, but Kadir says that seems to be intentional.

> 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?

Canonical types are often *really* ugly, especially with STL types (we don't have the "as written" form). And presenting the types twice might be at least as confusing/noisy as helpful. But if you have examples where this would be better, it'd be interesting.


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