Skip to content

Commit 8294236

Browse files
dmcppcheckclaude
andcommitted
Tests: a function-like macro name at the end of the file should not be an error
gcc outputs the name, simplecpp reports wrong number of parameters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 2ec914f commit 8294236

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎test.cpp‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,17 +1150,19 @@ static void define_invalid_3()
11501150
const char code[] = "#define R()\n"
11511151
"R\n";
11521152
simplecpp::OutputList outputList;
1153-
ASSERT_EQUALS("", preprocess(code, &outputList));
1154-
ASSERT_EQUALS("file0,2,syntax_error,failed to expand 'R', Wrong number of parameters for macro 'R'.\n", toString(outputList));
1153+
// TODO: a function-like macro name at the end of the file is not a macro call, gcc outputs R
1154+
TODO_ASSERT_EQUALS("\nR", "", preprocess(code, &outputList));
1155+
TODO_ASSERT_EQUALS("", "file0,2,syntax_error,failed to expand 'R', Wrong number of parameters for macro 'R'.\n", toString(outputList));
11551156
}
11561157

11571158
static void define_invalid_4()
11581159
{
11591160
const char code[] = "#define X(...)\n"
11601161
"X\n";
11611162
simplecpp::OutputList outputList;
1162-
ASSERT_EQUALS("", preprocess(code, &outputList));
1163-
ASSERT_EQUALS("file0,2,syntax_error,failed to expand 'X', Wrong number of parameters for macro 'X'.\n", toString(outputList));
1163+
// TODO: a function-like macro name at the end of the file is not a macro call, gcc outputs X
1164+
TODO_ASSERT_EQUALS("\nX", "", preprocess(code, &outputList));
1165+
TODO_ASSERT_EQUALS("", "file0,2,syntax_error,failed to expand 'X', Wrong number of parameters for macro 'X'.\n", toString(outputList));
11641166
}
11651167

11661168
static void define_define_1()

0 commit comments

Comments
 (0)