@@ -698,15 +698,15 @@ static void define_invalid_1()
698698 const char code[] = " #define A(\n B\n " ;
699699 simplecpp::OutputList outputList;
700700 ASSERT_EQUALS (" " , preprocess (code, &outputList));
701- ASSERT_EQUALS (" file0,1,syntax_error,Failed to parse #define\n " , toString (outputList));
701+ ASSERT_EQUALS (" file0,1,syntax_error,Failed to parse #define, bad macro syntax \n " , toString (outputList));
702702}
703703
704704static void define_invalid_2 ()
705705{
706706 const char code[] = " #define\n has#" ;
707707 simplecpp::OutputList outputList;
708708 ASSERT_EQUALS (" " , preprocess (code, &outputList));
709- ASSERT_EQUALS (" file0,1,syntax_error,Failed to parse #define\n " , toString (outputList));
709+ ASSERT_EQUALS (" file0,1,syntax_error,Failed to parse #define, bad macro syntax \n " , toString (outputList));
710710}
711711
712712static void define_define_1 ()
@@ -1105,6 +1105,15 @@ static void define_va_opt_8()
11051105 ASSERT_EQUALS (" " , toString (outputList));
11061106}
11071107
1108+ static void define_va_opt_9 ()
1109+ {
1110+ simplecpp::DUI dui;
1111+ dui.defines .emplace_back (" f(...)=__VA_OPT__" );
1112+ simplecpp::OutputList outputList;
1113+ ASSERT_EQUALS (" " , preprocess (" " , dui, &outputList));
1114+ ASSERT_EQUALS (" file0,0,dui_error,In definition of 'f': Missing opening parenthesis for __VA_OPT__\n " , toString (outputList));
1115+ }
1116+
11081117static void define_ifdef ()
11091118{
11101119 const char code[] = " #define A(X) X\n "
@@ -3674,6 +3683,7 @@ int main(int argc, char **argv)
36743683 TEST_CASE (define_va_opt_6);
36753684 TEST_CASE (define_va_opt_7);
36763685 TEST_CASE (define_va_opt_8);
3686+ TEST_CASE (define_va_opt_9); // #632
36773687
36783688 TEST_CASE (pragma_backslash); // multiline pragma directive
36793689
0 commit comments