diff --git a/clang-tools-extra/clangd/InlayHints.cpp b/clang-tools-extra/clangd/InlayHints.cpp --- a/clang-tools-extra/clangd/InlayHints.cpp +++ b/clang-tools-extra/clangd/InlayHints.cpp @@ -676,7 +676,8 @@ // For structured bindings, print canonical types. This is important // because for bindings that use the tuple_element protocol, the // non-canonical types would be "tuple_element::type". - if (auto Type = Binding->getType(); !Type.isNull()) + if (auto Type = Binding->getType(); + !Type.isNull() && !Type->isDependentType()) addTypeHint(Binding->getLocation(), Type.getCanonicalType(), /*Prefix=*/": "); } diff --git a/clang-tools-extra/clangd/unittests/InlayHintTests.cpp b/clang-tools-extra/clangd/unittests/InlayHintTests.cpp --- a/clang-tools-extra/clangd/unittests/InlayHintTests.cpp +++ b/clang-tools-extra/clangd/unittests/InlayHintTests.cpp @@ -1333,6 +1333,11 @@ // FIXME: It would be nice to show "T" as the hint. auto $var2[[var2]] = arg; } + + template + void bar(T arg) { + auto [a, b] = arg; + } )cpp"); }