nridge added a comment.

Thanks, I think this behaviour change is reasonable.



================
Comment at: clang-tools-extra/clangd/InlayHints.cpp:667
+    // print the underlying type for `decltype(expr)`
+    if (T->isDecltypeType())
+      TypeHintPolicy.PrintCanonicalTypes = true;
----------------
Can we factor out a function `ShouldPrintCanonicalType(QualType)`, and add a 
comment like this in its implementation:

```
// The sugared type is more useful in some cases, and the canonical
// type in other cases. For now, prefer the sugared type unless
// we are printing `decltype(expr)`. This could be refined further
// (see https://github.com/clangd/clangd/issues/1298).
```

Then in this function we can set:

```
TypeHintPolicy.PrintCanonicalTypes = ShouldPrintCanonicalType(T);
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140814

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to