cor3ntin wrote:

> I'm not sure I understand, because MLTAL doesn't seem to own the arguments in 
> the first place, so copying it doesn't seem of any help.

Well, yes, we would have to create a copy of the argument list corresponding to 
the depth of the pack we are trying to deduce.
There may be a better solution to implement 
https://eel.is/c++draft/temp.arg.explicit#9.
Maybe @mizvekov would have an idea. But I suspect any such solution would be an 
even bigger refactor.

So, unless we have a clever idea, I would like to see explored a solution that 
clones `MultiLevelTemplateArgumentList` instead of mutating it in place. 
(`TemplateInstantiator` would own a stack of `SmallVector<TemplateArgument>`) 
We could also add in `MultiLevelTemplateArgumentList::ArgList` an 
`optional<unsigned>` that tracks if a given template argument should be treated 
to be null, such that cloning a `MultiLevelTemplateArgumentList` just sets that 
optional.

This would limit the changes to `TemplateInstantiator`



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

Reply via email to