================
@@ -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();
----------------
zyn0217 wrote:
I realized the only client of isAnyArgInstantiationDependent() is indeed us, so
I moved the check there.
https://github.com/llvm/llvm-project/pull/174698
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits