diff --git a/lib/checkother.cpp b/lib/checkother.cpp index b2b912a38..c48e6b735 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -1368,7 +1368,7 @@ void CheckOther::checkConstVariable() if (Function::returnsReference(function)) { std::vector returns = Function::findReturns(function); if (std::any_of(returns.begin(), returns.end(), [&](const Token* retTok) { - if (retTok->varId() == var->declarationId()) + if (retTok->varId() == var->declarationId()) return true; while (retTok && retTok->isCast()) retTok = retTok->astOperand2();