Skip to content

Commit

Permalink
Update checkclass.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github authored Apr 8, 2024
1 parent ec2c56e commit 5699aee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/checkclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3338,17 +3338,17 @@ void CheckClass::checkReturnReference()
warn = true;
}
if (warn)
returnReferenceError(&func, var);
returnByReferenceError(&func, var);
}
}
}
}

void CheckClass::returnReferenceError(const Function* func, const Variable* var)
void CheckClass::returnByReferenceError(const Function* func, const Variable* var)
{
const Token* tok = func ? func->tokenDef : nullptr;
const std::string message = "Function '" + (func ? func->name() : "") + "()' should return member '" + (var ? var->name() : "") + "' by const reference.";
reportError(tok, Severity::style, "returnReference", message);
reportError(tok, Severity::style, "returnByReference", message);
}

void CheckClass::checkThisUseAfterFree()
Expand Down

0 comments on commit 5699aee

Please sign in to comment.