Skip to content

Commit d07aeb4

Browse files
committed
Dedicated ID
1 parent 2a00851 commit d07aeb4

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

lib/checkother.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4074,7 +4074,8 @@ void CheckOther::funcArgNamesDifferent(const std::string & functionName, nonneg
40744074
const Token* declaration, const Token* definition)
40754075
{
40764076
std::list<const Token *> tokens = { declaration,definition };
4077-
reportError(tokens, Severity::style, "funcArgNamesDifferent",
4077+
const std::string id = (declaration != nullptr) == (definition != nullptr) ? "funcArgNamesDifferent" : "funcArgNamesDifferentUnnamed";
4078+
reportError(tokens, Severity::style, id,
40784079
"$symbol:" + functionName + "\n"
40794080
"Function '$symbol' argument " + std::to_string(index + 1) + " names different: declaration '" +
40804081
(declaration ? declaration->str() : "<unnamed>") + "' definition '" +

test/testother.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12776,8 +12776,8 @@ class TestOther : public TestFixture {
1277612776
"void h(int);\n"
1277712777
"void h(int) {}\n");
1277812778
ASSERT_EQUALS(
12779-
"[test.cpp:1:12]: (style, inconclusive) Function 'f' argument 1 names different: declaration 'a' definition '<unnamed>'. [funcArgNamesDifferent]\n"
12780-
"[test.cpp:4:12]: (style, inconclusive) Function 'g' argument 1 names different: declaration '<unnamed>' definition 'b'. [funcArgNamesDifferent]\n",
12779+
"[test.cpp:1:12]: (style, inconclusive) Function 'f' argument 1 names different: declaration 'a' definition '<unnamed>'. [funcArgNamesDifferentUnnamed]\n"
12780+
"[test.cpp:4:12]: (style, inconclusive) Function 'g' argument 1 names different: declaration '<unnamed>' definition 'b'. [funcArgNamesDifferentUnnamed]\n",
1278112781
errout_str());
1278212782
}
1278312783

0 commit comments

Comments
 (0)