@@ -4867,22 +4867,22 @@ bool Sema::BuiltinVAStart(unsigned BuiltinID, CallExpr *TheCall) {
4867
4867
// current function or method. In C23 mode, if the second argument is an
4868
4868
// integer constant expression with value 0, then we don't bother with this
4869
4869
// check.
4870
- bool SecondArgIsLastNamedArgument = false;
4870
+ bool SecondArgIsLastNonVariadicArgument = false;
4871
4871
const Expr *Arg = TheCall->getArg(1)->IgnoreParenCasts();
4872
4872
if (std::optional<llvm::APSInt> Val =
4873
4873
TheCall->getArg(1)->getIntegerConstantExpr(Context);
4874
4874
Val && LangOpts.C23 && *Val == 0)
4875
4875
return false;
4876
4876
4877
- // These are valid if SecondArgIsLastNamedArgument is false after the next
4878
- // block.
4877
+ // These are valid if SecondArgIsLastNonVariadicArgument is false after the
4878
+ // next block.
4879
4879
QualType Type;
4880
4880
SourceLocation ParamLoc;
4881
4881
bool IsCRegister = false;
4882
4882
4883
4883
if (const DeclRefExpr *DR = dyn_cast<DeclRefExpr>(Arg)) {
4884
4884
if (const ParmVarDecl *PV = dyn_cast<ParmVarDecl>(DR->getDecl())) {
4885
- SecondArgIsLastNamedArgument = PV == LastParam;
4885
+ SecondArgIsLastNonVariadicArgument = PV == LastParam;
4886
4886
4887
4887
Type = PV->getType();
4888
4888
ParamLoc = PV->getLocation();
@@ -4891,7 +4891,7 @@ bool Sema::BuiltinVAStart(unsigned BuiltinID, CallExpr *TheCall) {
4891
4891
}
4892
4892
}
4893
4893
4894
- if (!SecondArgIsLastNamedArgument )
4894
+ if (!SecondArgIsLastNonVariadicArgument )
4895
4895
Diag(TheCall->getArg(1)->getBeginLoc(),
4896
4896
diag::warn_second_arg_of_va_start_not_last_non_variadic_param);
4897
4897
else if (IsCRegister || Type->isReferenceType() ||
0 commit comments