================
@@ -1197,25 +1197,17 @@ Decl
*TemplateDeclInstantiator::VisitDecompositionDecl(DecompositionDecl *D) {
for (auto *NewBD : NewBindings)
NewBD->setInvalidDecl();
- if (OldResolvedPack) {
- // Mark the holding vars (if any) in the pack as instantiated since
- // they are created implicitly.
+ if (OldBindingPack) {
+ // Mark the bindings in the pack as instantiated.
auto Bindings = NewDD->bindings();
- auto BPack = llvm::find_if(
+ auto NewBindingPack = *llvm::find_if(
Bindings, [](BindingDecl *D) -> bool { return D->isParameterPack(); });
- auto *NewResolvedPack =
- cast<ResolvedUnexpandedPackExpr>((*BPack)->getBinding());
- auto OldExprs = OldResolvedPack->getExprs();
- auto NewExprs = NewResolvedPack->getExprs();
- assert(OldExprs.size() == NewExprs.size());
- for (unsigned I = 0; I < OldResolvedPack->getNumExprs(); I++) {
- DeclRefExpr *OldDRE = cast<DeclRefExpr>(OldExprs[I]);
- BindingDecl *OldNestedBD = cast<BindingDecl>(OldDRE->getDecl());
- DeclRefExpr *NewDRE = cast<DeclRefExpr>(NewExprs[I]);
- BindingDecl *NewNestedBD = cast<BindingDecl>(NewDRE->getDecl());
- SemaRef.CurrentInstantiationScope->InstantiatedLocal(OldNestedBD,
- NewNestedBD);
- }
+ auto OldDecls = OldBindingPack->getBindingPackDecls();
----------------
erichkeane wrote:
We shouldn't be using 'auto' on either of these. I realize they already were,
but please change them anyway.,
https://github.com/llvm/llvm-project/pull/125394
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits