[PATCH] D128745: [c++] implements DR692, DR1395 and tentatively DR1432, about partial ordering of variadic template partial specialization or function template
Erich Keane via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 12 07:24:30 PDT 2022
erichkeane added inline comments.
================
Comment at: clang/lib/Sema/SemaTemplateDeduction.cpp:1110
+ // Ai is ignored;
+ if (PartialOrdering && ArgIdx + 1 == NumArgs &&
+ isa<PackExpansionType>(Args[ArgIdx]))
----------------
aaron.ballman wrote:
> Why are you checking `ArgIdx + 1 == NumArgs` here? It looks like you're only handling the case where the pack is the last argument, but packs can appear anywhere, right?
This is definitely a concern to me as well, we probably have to check ALL packs and figure out what was deduced.
================
Comment at: clang/lib/Sema/SemaTemplateDeduction.cpp:5198
+ unsigned NumParams2 = FD2->getNumParams();
+ bool Variadic1 = NumParams1 && FD1->parameters().back()->isParameterPack();
+ bool Variadic2 = NumParams2 && FD2->parameters().back()->isParameterPack();
----------------
This is still the same issue I think? This should probably be a 'parameters contains pack', not just checking the last.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D128745/new/
https://reviews.llvm.org/D128745
More information about the cfe-commits
mailing list