@@ -3156,44 +3156,44 @@ Sema::SubstParmVarDecl(ParmVarDecl *OldParm,
31563156 const MultiLevelTemplateArgumentList &TemplateArgs,
31573157 int indexAdjustment, UnsignedOrNone NumExpansions,
31583158 bool ExpectParameterPack, bool EvaluateConstraint) {
3159- TypeSourceInfo *OldDI = OldParm->getTypeSourceInfo ();
3160- TypeSourceInfo *NewDI = nullptr ;
3159+ TypeSourceInfo *OldTSI = OldParm->getTypeSourceInfo ();
3160+ TypeSourceInfo *NewTSI = nullptr ;
31613161
3162- TypeLoc OldTL = OldDI ->getTypeLoc ();
3162+ TypeLoc OldTL = OldTSI ->getTypeLoc ();
31633163 if (PackExpansionTypeLoc ExpansionTL = OldTL.getAs <PackExpansionTypeLoc>()) {
31643164
31653165 // We have a function parameter pack. Substitute into the pattern of the
31663166 // expansion.
3167- NewDI = SubstType (ExpansionTL.getPatternLoc (), TemplateArgs,
3168- OldParm->getLocation (), OldParm->getDeclName ());
3169- if (!NewDI )
3167+ NewTSI = SubstType (ExpansionTL.getPatternLoc (), TemplateArgs,
3168+ OldParm->getLocation (), OldParm->getDeclName ());
3169+ if (!NewTSI )
31703170 return nullptr ;
31713171
3172- if (NewDI ->getType ()->containsUnexpandedParameterPack ()) {
3172+ if (NewTSI ->getType ()->containsUnexpandedParameterPack ()) {
31733173 // We still have unexpanded parameter packs, which means that
31743174 // our function parameter is still a function parameter pack.
31753175 // Therefore, make its type a pack expansion type.
3176- NewDI = CheckPackExpansion (NewDI , ExpansionTL.getEllipsisLoc (),
3177- NumExpansions);
3176+ NewTSI = CheckPackExpansion (NewTSI , ExpansionTL.getEllipsisLoc (),
3177+ NumExpansions);
31783178 } else if (ExpectParameterPack) {
31793179 // We expected to get a parameter pack but didn't (because the type
31803180 // itself is not a pack expansion type), so complain. This can occur when
31813181 // the substitution goes through an alias template that "loses" the
31823182 // pack expansion.
31833183 Diag (OldParm->getLocation (),
31843184 diag::err_function_parameter_pack_without_parameter_packs)
3185- << NewDI ->getType ();
3185+ << NewTSI ->getType ();
31863186 return nullptr ;
31873187 }
31883188 } else {
3189- NewDI = SubstType (OldDI , TemplateArgs, OldParm->getLocation (),
3190- OldParm->getDeclName ());
3189+ NewTSI = SubstType (OldTSI , TemplateArgs, OldParm->getLocation (),
3190+ OldParm->getDeclName ());
31913191 }
31923192
3193- if (!NewDI )
3193+ if (!NewTSI )
31943194 return nullptr ;
31953195
3196- if (NewDI ->getType ()->isVoidType ()) {
3196+ if (NewTSI ->getType ()->isVoidType ()) {
31973197 Diag (OldParm->getLocation (), diag::err_param_with_void_type);
31983198 return nullptr ;
31993199 }
@@ -3205,7 +3205,7 @@ Sema::SubstParmVarDecl(ParmVarDecl *OldParm,
32053205 // here, when the instantiated versions of those referenced parameters are in
32063206 // scope.
32073207 if (TemplateTypeParmDecl *TTP =
3208- GetContainedInventedTypeParmVisitor ().Visit (OldDI ->getType ())) {
3208+ GetContainedInventedTypeParmVisitor ().Visit (OldTSI ->getType ())) {
32093209 if (const TypeConstraint *TC = TTP->getTypeConstraint ()) {
32103210 auto *Inst = cast_or_null<TemplateTypeParmDecl>(
32113211 FindInstantiatedDecl (TTP->getLocation (), TTP, TemplateArgs));
@@ -3219,12 +3219,10 @@ Sema::SubstParmVarDecl(ParmVarDecl *OldParm,
32193219 }
32203220 }
32213221
3222- ParmVarDecl *NewParm = CheckParameter (Context.getTranslationUnitDecl (),
3223- OldParm->getInnerLocStart (),
3224- OldParm->getLocation (),
3225- OldParm->getIdentifier (),
3226- NewDI->getType (), NewDI,
3227- OldParm->getStorageClass ());
3222+ ParmVarDecl *NewParm = CheckParameter (
3223+ Context.getTranslationUnitDecl (), OldParm->getInnerLocStart (),
3224+ OldParm->getLocation (), OldParm->getIdentifier (), NewTSI->getType (),
3225+ NewTSI, OldParm->getStorageClass ());
32283226 if (!NewParm)
32293227 return nullptr ;
32303228
0 commit comments