Fix a typo in CheckExprLifetime.cpp, NFC

This commit is contained in:
Haojian Wu 2024-09-05 13:17:17 +02:00
parent 95684afbcd
commit 87b4b64858

View File

@ -328,7 +328,7 @@ static bool shouldTrackFirstArgument(const FunctionDecl *FD) {
// We assuments that a normal assingment operator always returns *this, that is,
// an lvalue reference that is the same type as the implicit object parameter
// (or the LHS for a non-member operator$=).
static bool isNormalAsisgnmentOperator(const FunctionDecl *FD) {
static bool isNormalAssignmentOperator(const FunctionDecl *FD) {
OverloadedOperatorKind OO = FD->getDeclName().getCXXOverloadedOperator();
if (OO == OO_Equal || isCompoundAssignmentOperator(OO)) {
QualType RetT = FD->getReturnType();
@ -362,7 +362,7 @@ static bool implicitObjectParamIsLifetimeBound(const FunctionDecl *FD) {
return true;
}
return isNormalAsisgnmentOperator(FD);
return isNormalAssignmentOperator(FD);
}
// Visit lifetimebound or gsl-pointer arguments.
@ -940,10 +940,10 @@ static bool pathOnlyHandlesGslPointer(IndirectLocalPath &Path) {
return false;
}
static bool isAssginmentOperatorLifetimeBound(CXXMethodDecl *CMD) {
static bool isAssignmentOperatorLifetimeBound(CXXMethodDecl *CMD) {
if (!CMD)
return false;
return isNormalAsisgnmentOperator(CMD) && CMD->param_size() == 1 &&
return isNormalAssignmentOperator(CMD) && CMD->param_size() == 1 &&
CMD->getParamDecl(0)->hasAttr<LifetimeBoundAttr>();
}
@ -953,7 +953,7 @@ static bool shouldRunGSLAssignmentAnalysis(const Sema &SemaRef,
diag::warn_dangling_lifetime_pointer_assignment, SourceLocation());
return (EnableGSLAssignmentWarnings &&
(isRecordWithAttr<PointerAttr>(Entity.LHS->getType()) ||
isAssginmentOperatorLifetimeBound(Entity.AssignmentOperator)));
isAssignmentOperatorLifetimeBound(Entity.AssignmentOperator)));
}
static void checkExprLifetimeImpl(Sema &SemaRef,