[clang][Sema] Fix typo in checkBuiltinArgument helper

The checkBuiltinArgument helper takes an integer ArgIndex and is
documented as performing normal type-checking on that argument. However,
it mistakenly hardcodes the argument index to zero when retrieving the
argument from the call expression.

This hadn't been noticed previously as all in-tree uses typecheck the
0th argument anyway.
This commit is contained in:
Alex Bradbury 2022-04-20 14:28:42 +01:00
parent 95f0f69441
commit bea5e88bcf
1 changed files with 1 additions and 1 deletions

View File

@ -6222,7 +6222,7 @@ static bool checkBuiltinArgument(Sema &S, CallExpr *E, unsigned ArgIndex) {
InitializedEntity Entity =
InitializedEntity::InitializeParameter(S.Context, Param);
ExprResult Arg = E->getArg(0);
ExprResult Arg = E->getArg(ArgIndex);
Arg = S.PerformCopyInitialization(Entity, SourceLocation(), Arg);
if (Arg.isInvalid())
return true;