Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/vf_settokenvalue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ namespace ValueFlow
// 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())) &&
!(callParent->str() == "(" && (Token::simpleMatch(callParent->astOperand1(), "*") || Token::Match(callParent->astOperand1(), "%name%|("))))) {
!(callParent->str() == "(" && Token::Match(callParent->astOperand1(), "%name%|(|[|*|.")))) {
setTokenValue(parent, std::move(value), settings);
return;
}
Expand Down
12 changes: 12 additions & 0 deletions test/testother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13682,6 +13682,18 @@ class TestOther : public TestFixture {
" return MACRO(true);\n"
"}\n");
ASSERT_EQUALS("", errout_str());

check("struct S {\n" // #15063
" int (*f)(int, int);\n"
" int (*a[2])(int, int);\n"
"};\n"
"int g1(struct S* p, int x) {\n"
" return (p->f)(x, 10);\n"
"}\n"
"int g2(struct S s, int x) {\n"
" return s.a[0](x, 10);\n"
"}\n");
ASSERT_EQUALS("", errout_str());
}

void knownArgumentHiddenVariableExpression() {
Expand Down
Loading