Skip to content

Commit 67b798d

Browse files
Update test.cpp
1 parent 40158a4 commit 67b798d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,16 @@ static void define_va_opt_7()
10411041
toString(outputList));
10421042
}
10431043

1044+
static void define_va_opt_8()
1045+
{
1046+
const char code[] = "#define f(...) #__VA_OPT__(x)\n"
1047+
"const char* v1 = f();";
1048+
1049+
simplecpp::OutputList outputList;
1050+
ASSERT_EQUALS("\nconst char * v1 = \"\" ;", preprocess(code, &outputList));
1051+
ASSERT_EQUALS("", toString(outputList));
1052+
}
1053+
10441054
static void define_ifdef()
10451055
{
10461056
const char code[] = "#define A(X) X\n"
@@ -3350,6 +3360,7 @@ int main(int argc, char **argv)
33503360
TEST_CASE(define_va_opt_5);
33513361
TEST_CASE(define_va_opt_6);
33523362
TEST_CASE(define_va_opt_7);
3363+
TEST_CASE(define_va_opt_8);
33533364

33543365
TEST_CASE(pragma_backslash); // multiline pragma directive
33553366

0 commit comments

Comments
 (0)