parent
078e967ab2
commit
f6340c02da
|
@ -635,7 +635,8 @@ static void setTokenValue(Token* tok,
|
|||
});
|
||||
// Ensure that the comma isn't a function call
|
||||
if (!callParent || (!Token::Match(callParent->previous(), "%name%|> (") && !Token::simpleMatch(callParent, "{") &&
|
||||
(!Token::Match(callParent, "( %name%") || settings->library.isNotLibraryFunction(callParent->next())))) {
|
||||
(!Token::Match(callParent, "( %name%") || settings->library.isNotLibraryFunction(callParent->next())) &&
|
||||
!(callParent->str() == "(" && Token::simpleMatch(callParent->astOperand1(), "*")))) {
|
||||
setTokenValue(parent, std::move(value), settings);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -5129,6 +5129,13 @@ private:
|
|||
value = valueOfTok(code, "1");
|
||||
ASSERT_EQUALS(1, value.intvalue);
|
||||
ASSERT_EQUALS(false, value.isKnown());
|
||||
|
||||
code = "void f(char c, struct T* t) {\n" // #11894
|
||||
" (*t->func)(&c, 1, t->ptr);\n"
|
||||
"}\n";
|
||||
value = valueOfTok(code, ", 1");
|
||||
ASSERT_EQUALS(0, value.intvalue);
|
||||
ASSERT_EQUALS(false, value.isKnown());
|
||||
}
|
||||
|
||||
void valueFlowSizeofForwardDeclaredEnum() {
|
||||
|
|
Loading…
Reference in New Issue