================
@@ -1611,13 +1618,28 @@ namespace {
       }
       return Type;
     }
+
     // Override the default version to handle a rewrite-template-arg-pack case
     // for building a deduction guide.
     bool TransformTemplateArgument(const TemplateArgumentLoc &Input,
                                    TemplateArgumentLoc &Output,
                                    bool Uneval = false) {
       const TemplateArgument &Arg = Input.getArgument();
       std::vector<TemplateArgument> TArgs;
+      if (auto *Cache = SemaRef.CurrentCachedTemplateArgs;
+          TemplateArgsHashValue && Cache) {
+        llvm::FoldingSetNodeID ID = *TemplateArgsHashValue;
+        ID.AddInteger(SemaRef.ArgPackSubstIndex.toInternalRepresentation());
+        Input.getArgument().Profile(ID, SemaRef.Context);
----------------
zyn0217 wrote:

Thinking twice, I realized that this cache would inevitably break TypeLoc 
fidelity of normalized template arguments.

So we limit the cache to only concept substitutions and valid transforms, where 
the transformed TypeLoc may not necessarily make a difference.

Any suggestion is welcome, to fix the problem that the normalization duplicated 
template parameters and entailed too many transforms.


https://github.com/llvm/llvm-project/pull/188421
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to