Skip to content

Commit 6ecbeba

Browse files
committed
[Clang] Rename SecondArgIsLastNamedArgument for clarity and consistency
1 parent 841f463 commit 6ecbeba

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

clang/lib/Sema/SemaChecking.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4867,22 +4867,22 @@ bool Sema::BuiltinVAStart(unsigned BuiltinID, CallExpr *TheCall) {
48674867
// current function or method. In C23 mode, if the second argument is an
48684868
// integer constant expression with value 0, then we don't bother with this
48694869
// check.
4870-
bool SecondArgIsLastNamedArgument = false;
4870+
bool SecondArgIsLastNonVariadicArgument = false;
48714871
const Expr *Arg = TheCall->getArg(1)->IgnoreParenCasts();
48724872
if (std::optional<llvm::APSInt> Val =
48734873
TheCall->getArg(1)->getIntegerConstantExpr(Context);
48744874
Val && LangOpts.C23 && *Val == 0)
48754875
return false;
48764876

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.
48794879
QualType Type;
48804880
SourceLocation ParamLoc;
48814881
bool IsCRegister = false;
48824882

48834883
if (const DeclRefExpr *DR = dyn_cast<DeclRefExpr>(Arg)) {
48844884
if (const ParmVarDecl *PV = dyn_cast<ParmVarDecl>(DR->getDecl())) {
4885-
SecondArgIsLastNamedArgument = PV == LastParam;
4885+
SecondArgIsLastNonVariadicArgument = PV == LastParam;
48864886

48874887
Type = PV->getType();
48884888
ParamLoc = PV->getLocation();
@@ -4891,7 +4891,7 @@ bool Sema::BuiltinVAStart(unsigned BuiltinID, CallExpr *TheCall) {
48914891
}
48924892
}
48934893

4894-
if (!SecondArgIsLastNamedArgument)
4894+
if (!SecondArgIsLastNonVariadicArgument)
48954895
Diag(TheCall->getArg(1)->getBeginLoc(),
48964896
diag::warn_second_arg_of_va_start_not_last_non_variadic_param);
48974897
else if (IsCRegister || Type->isReferenceType() ||

0 commit comments

Comments
 (0)