diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 4628dd0d774..e63ad0d457c 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -4044,8 +4044,8 @@ void CheckOther::checkFuncArgNamesDifferent() decl = decl->nextArgument(); break; } - // skip over template - if (decl->link() && decl->str() == "<") + // skip over templates and arrays + if (decl->link() && decl->str() != "(") decl = decl->link(); else if (decl->varId()) declarations[j] = decl; diff --git a/test/testother.cpp b/test/testother.cpp index 42f83a14ca2..4dd283d9473 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -12930,6 +12930,10 @@ class TestOther : public TestFixture { "[test.cpp:9:20] -> [test.cpp:14:22]: (warning) Function 'func2' argument order different: declaration 'a, b, c' definition 'c, b, a' [funcArgOrderDifferent]\n" "[test.cpp:10:20] -> [test.cpp:15:22]: (warning) Function 'func3' argument order different: declaration 'a, b, c' definition 'c, b, a' [funcArgOrderDifferent]\n" "[test.cpp:11:16] -> [test.cpp:16:22]: (warning) Function 'func4' argument order different: declaration ', b, c' definition 'c, b, a' [funcArgOrderDifferent]\n", errout_str()); + + check("void f(int N, const int a[N], const int b[N]);\n" // #14710 + "void f(int N, const int a[N], const int b[N]) {}\n"); + ASSERT_EQUALS("", errout_str()); } // #7846 - Syntax error when using C++11 braced-initializer in default argument