From ae0ca4803963bf7053b4f5a3deaf7b2d495e291e Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 12 Oct 2026 11:24:01 +0200 Subject: [PATCH 1/5] Update vf_settokenvalue.cpp --- lib/vf_settokenvalue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vf_settokenvalue.cpp b/lib/vf_settokenvalue.cpp index 1d6179fb9af..0f41e814844 100644 --- a/lib/vf_settokenvalue.cpp +++ b/lib/vf_settokenvalue.cpp @@ -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; } From 33fe92774cb3cfcf7238e300c219dafe87723ee5 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 12 Oct 2026 11:29:15 +0200 Subject: [PATCH 2/5] Update testother.cpp --- test/testother.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/testother.cpp b/test/testother.cpp index d5d6036718e..91c9018636c 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -13682,6 +13682,14 @@ class TestOther : public TestFixture { " return MACRO(true);\n" "}\n"); ASSERT_EQUALS("", errout_str()); + + check("struct S {\n" // #15063 + " int (*f)(int a, int n);\n" + "};\n" + "int g(struct S* p, int x) {\n" + " return (p->f)(x, 10);\n" + "}\n"); + ASSERT_EQUALS("", errout_str()); } void knownArgumentHiddenVariableExpression() { From ee06c4593b71b8d7c110aa6ab6ac7d68d24c8fef Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 12 Oct 2026 12:41:10 +0200 Subject: [PATCH 3/5] Update testother.cpp --- test/testother.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testother.cpp b/test/testother.cpp index 91c9018636c..ea1aefba573 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -13688,7 +13688,7 @@ class TestOther : public TestFixture { "};\n" "int g(struct S* p, int x) {\n" " return (p->f)(x, 10);\n" - "}\n"); + "}\n"); ASSERT_EQUALS("", errout_str()); } From 7562504d297c7a45313b9bbbe59d59239e8af716 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Tue, 13 Oct 2026 09:03:10 +0200 Subject: [PATCH 4/5] Update vf_settokenvalue.cpp [skip ci] --- lib/vf_settokenvalue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vf_settokenvalue.cpp b/lib/vf_settokenvalue.cpp index 0f41e814844..8c24b9c0225 100644 --- a/lib/vf_settokenvalue.cpp +++ b/lib/vf_settokenvalue.cpp @@ -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::Match(callParent->astOperand1(), "%name%|(|*|.")))) { + !(callParent->str() == "(" && Token::Match(callParent->astOperand1(), "%name%|(|[|*|.")))) { setTokenValue(parent, std::move(value), settings); return; } From 5ea92e62e9c3182074e88d5425b38632bcdcfa9a Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Tue, 13 Oct 2026 09:06:08 +0200 Subject: [PATCH 5/5] Update testother.cpp --- test/testother.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/testother.cpp b/test/testother.cpp index ea1aefba573..96e027692b3 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -13684,10 +13684,14 @@ class TestOther : public TestFixture { ASSERT_EQUALS("", errout_str()); check("struct S {\n" // #15063 - " int (*f)(int a, int n);\n" + " int (*f)(int, int);\n" + " int (*a[2])(int, int);\n" "};\n" - "int g(struct S* p, int x) {\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()); }