================
@@ -1666,6 +1685,21 @@ namespace {
       return inherited::TransformTemplateArgument(Input, Output, Uneval);
     }
 
+    using TreeTransform::TransformTemplateSpecializationType;
+    QualType
+    TransformTemplateSpecializationType(TypeLocBuilder &TLB,
+                                        TemplateSpecializationTypeLoc TL) {
+      auto *T = TL.getTypePtr();
+      if (!getSema().ArgPackSubstIndex || !T->isSugared() ||
+          !isPackProducingBuiltinTemplateName(T->getTemplateName()))
+        return TreeTransform::TransformTemplateSpecializationType(TLB, TL);
+      // Look through sugar to get to the SubstBuiltinTemplatePackType that we
+      // need to substitute into.
+      QualType R = TransformType(T->desugar());
----------------
mizvekov wrote:

Yes the default TreeTransform implementation will rerun semantic actions, so 
its a bit inefficient for sugar-only transforms, but you can customize that by 
providing overrides for the Rebuild* functions.

The issue I see in this case here is that you are just dropping the 
TemplateSpecializationType, why can't you just build a new one here to wrap 
over the transformed underlying type?

https://github.com/llvm/llvm-project/pull/106730
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to