[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #94981)
Matheus Izvekov via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 5 13:55:53 PDT 2024
================
@@ -5327,9 +5332,29 @@ bool Sema::CheckTemplateArgumentList(
SmallVector<TemplateArgument, 2> CanonicalArgumentPack;
unsigned ArgIdx = 0, NumArgs = NewArgs.size();
LocalInstantiationScope InstScope(*this, true);
- for (TemplateParameterList::iterator Param = Params->begin(),
- ParamEnd = Params->end();
- Param != ParamEnd; /* increment in loop */) {
+ for (TemplateParameterList::iterator ParamBegin = Params->begin(),
+ ParamEnd = Params->end(),
+ Param = ParamBegin;
+ Param != ParamEnd;
+ /* increment in loop */) {
+ if (size_t ParamIdx = Param - ParamBegin;
+ DefaultArgs && ParamIdx >= DefaultArgs.StartPos) {
+ // All written arguments should have been consumed by this point.
+ assert(ArgIdx == NumArgs && "bad default argument deduction");
+ // FIXME: Don't ignore parameter packs.
----------------
mizvekov wrote:
This is already tested and tackled in the next patch in the series, the P0522 complete implementation one.
https://github.com/llvm/llvm-project/pull/94981
More information about the cfe-commits
mailing list