Skip to content
Merged
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
4 changes: 2 additions & 2 deletions lib/checkother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions test/testother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading