diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index 66ab3578560..1a42f8ab820 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -3348,7 +3348,7 @@ void CheckClass::checkReturnByReference() 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."; + const std::string message = "Function '" + (func ? func->name() : "func") + "()' should return member '" + (var ? var->name() : "var") + "' by const reference."; reportError(tok, Severity::performance, "returnByReference", message); }