================
@@ -3158,6 +3161,33 @@ checkBuiltinTemplateIdType(Sema &SemaRef, 
BuiltinTemplateDecl *BTD,
     int64_t N = Index.getExtValue();
     return Ts.getPackAsArray()[N].getAsType();
   }
+  case BTK__type_pack_dedup: {
+    assert(Converted.size() == 2 && "__builtin_type_pack_dedup should be given 
"
+                                    "a template and a parameter pack");
+    TemplateArgument Template = Converted[0];
+    TemplateArgument Ts = Converted[1];
+    if (Template.isDependent() || Ts.isDependent())
----------------
mizvekov wrote:

I think the only reason we would need to hold off on building the template 
specialization would be if Ts contains an unexpanded pack, otherwise we are 
good to go, subsequent substitutions will produce the correct type list anyway.

This would also reduce the size of the argument list.

Be aware that holding this specialization will make this builtin appear in 
mangling, so I'd avoid doing that unless necessary.

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