diff --git a/lib/exprengine.cpp b/lib/exprengine.cpp index d980f8414..a9a82d9d1 100644 --- a/lib/exprengine.cpp +++ b/lib/exprengine.cpp @@ -1538,10 +1538,14 @@ static ExprEngine::ValuePtr executeFunctionCall(const Token *tok, Data &data) return retVal; } + const bool hasBody = tok->astOperand1()->function() && tok->astOperand1()->function()->hasBody(); + std::vector argValues; for (const Token *argtok : getArguments(tok)) { - auto val = executeExpression1(argtok, data); + auto val = hasBody ? executeExpression1(argtok, data) : executeExpression(argtok, data); argValues.push_back(val); + if (hasBody) + continue; if (!argtok->valueType() || (argtok->valueType()->constness & 1) == 1) continue; if (auto arrayValue = std::dynamic_pointer_cast(val)) { diff --git a/test/bug-hunting/itc.py b/test/bug-hunting/itc.py index 384364647..a5f0f3f6d 100644 --- a/test/bug-hunting/itc.py +++ b/test/bug-hunting/itc.py @@ -42,8 +42,6 @@ def get_error_lines(filename): linenr = 242 # warn about usage elif linenr == 266: continue # no warning should be written - elif linenr == 295: - continue # FIXME: False negative ret.append(linenr) return ret