[PATCH] D156300: [clangd] Avoid unexpected desugaring in isSugaredTemplateParameter

Younan Zhang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 31 23:10:51 PDT 2023


zyounan added a comment.

Sorry, looks like I messed up with the commits before. Fixed it now.



================
Comment at: clang-tools-extra/clangd/InlayHints.cpp:207
+
+  // This is a bit tricky: we traverse the type structure and find whether or
+  // not a type in the desugaring process is of SubstTemplateTypeParmType.
----------------
nridge wrote:
> Nice find, this is indeed pretty tricky. I remember running into a similar issue before in https://reviews.llvm.org/D124690#inline-1205484.
Cool. That looks far more intricate and I should take some time to understand the context. Thanks for the reference :)


================
Comment at: clang-tools-extra/clangd/unittests/InlayHintTests.cpp:1432
 
 TEST(TypeHints, SubstTemplateParameterAliases) {
+  llvm::StringRef Header = R"cpp(
----------------
I feel like this test is becoming clunky: The validations here require an invented class template `vector` which I think should be better placed in a header; however, in the remaining snippet, it seems that I'm testing too many hints in one `assertHint` call. Should I split these cases into different snippets, or we just leave them as-is at the moment?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156300



More information about the cfe-commits mailing list