[clang-tools-extra] [clangd] Handle template template parameters in TargetFinder::VisitDeducedTemplateSpecializationType (PR #228601)

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 3 17:22:43 PDT 2026


================
@@ -397,14 +397,21 @@ struct TargetFinder {
         if (const auto *USD = DTST->getTemplateName().getAsUsingShadowDecl())
           Outer.add(USD, Flags);
 
-        // FIXME: This is a workaround for https://llvm.org/PR42914,
-        // which is causing DTST->getDeducedType() to be empty. We
-        // fall back to the template pattern and miss the instantiation
-        // even when it's known in principle. Once that bug is fixed,
-        // the following code can be removed (the existing handling in
-        // VisitDeducedType() is sufficient).
-        if (auto *TD = DTST->getTemplateName().getAsTemplateDecl())
+        TemplateDecl *TD = DTST->getTemplateName().getAsTemplateDecl();
+        // Template template parameters have no templated decl, so they must
+        // refer to the parameter itself.
+        if (const auto *Parm =
+                llvm::dyn_cast_or_null<TemplateTemplateParmDecl>(TD)) {
----------------
HighCommander4 wrote:

I also realized this means we have other gaps around pack indexing, for which I filed https://github.com/clangd/clangd/issues/2712.

https://github.com/llvm/llvm-project/pull/228601


More information about the cfe-commits mailing list