diff --git a/lib/checkleakautovar.cpp b/lib/checkleakautovar.cpp index 71872f263..b9409a524 100644 --- a/lib/checkleakautovar.cpp +++ b/lib/checkleakautovar.cpp @@ -329,7 +329,9 @@ void CheckLeakAutoVar::checkScope(const Token * const startToken, tokens.push(tok3->astOperand2()); continue; } - if (tok3->str() == "(" && !tok3->astOperand2()->varId()) { + if (tok3->str() == "(" && + tok3->astOperand2() && + tok3->astOperand2()->isConstOp()) { tokens.push(tok3->astOperand2()); continue; }