================
@@ -639,7 +639,14 @@ 
ConstraintSatisfactionChecker::SubstitutionInTemplateArguments(
         llvm::to_vector_of<TemplateArgument>(MLTAL.getOutermost());
   unsigned Offset = 0;
   for (unsigned I = 0, MappedIndex = 0; I < Used.size(); I++) {
-    TemplateArgument Arg;
+    // For template parameters that are not used during substitution, they
+    // still need to exist in the MLTAL since template parameter indices remain
+    // unchanged.
+    // We need a placeholder to represent them: a null TemplateArgument doesn't
+    // fit well due to non-null assumptions elsewhere. An empty pack serves 
this
+    // purpose, and substitution checks would catch any mistakes if we really
+    // messed anything up.
+    TemplateArgument Arg = TemplateArgument::getEmptyPack();
----------------
cor3ntin wrote:

Aren't we gonna run into the same issue of having empty packs where we don't 
expect them, instead of null arguments where we don't expect them - do we need 
a new kind of dummy template argument? 

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

Reply via email to