From c610346da4eda77e978a057d0eae2db63bc96a3c Mon Sep 17 00:00:00 2001 From: chrchr-github Date: Tue, 16 Jun 2026 20:26:26 +0200 Subject: [PATCH] Fix #14853 FP funcArgNamesDifferentUnnamed with function pointer argument --- lib/checkother.cpp | 2 +- test/testother.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 551c3a47543..70dc9e6b5f4 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -4052,7 +4052,7 @@ void CheckOtherImpl::checkFuncArgNamesDifferent() break; } // skip over templates and arrays - if (decl->link() && !Token::Match(decl, "[()]")) + if (decl->link() && (!Token::Match(decl, "[()]") || Token::simpleMatch(decl->tokAt(-1), ") ("))) decl = decl->link(); else if (decl->varId()) declarations[j] = decl; diff --git a/test/testother.cpp b/test/testother.cpp index c8a95c9882b..77ff5bd444b 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -12959,6 +12959,10 @@ class TestOther : public TestFixture { check("void f(void (*fp)(), int x);\n" // #14847 "void f(void (*fp)(), int x) {}\n"); ASSERT_EQUALS("", errout_str()); + + check("void f(void (*fp)(int a, int b), int b);\n" // #14853 + "void f(void (*fp)(int a, int b), int b) {}\n"); + ASSERT_EQUALS("", errout_str()); } void funcArgOrderDifferent() {