@@ -717,15 +717,15 @@ static void define_invalid_1()
717717 const char code[] = " #define A(\n B\n " ;
718718 simplecpp::OutputList outputList;
719719 ASSERT_EQUALS (" " , preprocess (code, &outputList));
720- ASSERT_EQUALS (" file0,1,syntax_error,Failed to parse #define\n " , toString (outputList));
720+ ASSERT_EQUALS (" file0,1,syntax_error,Failed to parse #define, bad macro syntax \n " , toString (outputList));
721721}
722722
723723static void define_invalid_2 ()
724724{
725725 const char code[] = " #define\n has#" ;
726726 simplecpp::OutputList outputList;
727727 ASSERT_EQUALS (" " , preprocess (code, &outputList));
728- ASSERT_EQUALS (" file0,1,syntax_error,Failed to parse #define\n " , toString (outputList));
728+ ASSERT_EQUALS (" file0,1,syntax_error,Failed to parse #define, bad macro syntax \n " , toString (outputList));
729729}
730730
731731static void define_define_1 ()
@@ -1124,6 +1124,17 @@ static void define_va_opt_8()
11241124 ASSERT_EQUALS (" " , toString (outputList));
11251125}
11261126
1127+ static void define_va_opt_9 ()
1128+ {
1129+ try {
1130+ simplecpp::DUI dui;
1131+ dui.defines .emplace_back (" f(...)=__VA_OPT__" );
1132+ simplecpp::OutputList outputList;
1133+ ASSERT_EQUALS (" " , preprocess (" " , dui, &outputList));
1134+ ASSERT_EQUALS (" file0,0,dui_error,In definition of 'f': Missing opening parenthesis for __VA_OPT__\n " , toString (outputList));
1135+ } catch (...) {}
1136+ }
1137+
11271138static void define_ifdef ()
11281139{
11291140 const char code[] = " #define A(X) X\n "
@@ -3739,6 +3750,7 @@ int main(int argc, char **argv)
37393750 TEST_CASE (define_va_opt_6);
37403751 TEST_CASE (define_va_opt_7);
37413752 TEST_CASE (define_va_opt_8);
3753+ TEST_CASE (define_va_opt_9); // #632
37423754
37433755 TEST_CASE (pragma_backslash); // multiline pragma directive
37443756
0 commit comments