@@ -687,15 +687,15 @@ static void define_invalid_1()
687687 const char code[] = " #define A(\n B\n " ;
688688 simplecpp::OutputList outputList;
689689 ASSERT_EQUALS (" " , preprocess (code, &outputList));
690- ASSERT_EQUALS (" file0,1,syntax_error,Failed to parse #define\n " , toString (outputList));
690+ ASSERT_EQUALS (" file0,1,syntax_error,Failed to parse #define, bad macro syntax \n " , toString (outputList));
691691}
692692
693693static void define_invalid_2 ()
694694{
695695 const char code[] = " #define\n has#" ;
696696 simplecpp::OutputList outputList;
697697 ASSERT_EQUALS (" " , preprocess (code, &outputList));
698- ASSERT_EQUALS (" file0,1,syntax_error,Failed to parse #define\n " , toString (outputList));
698+ ASSERT_EQUALS (" file0,1,syntax_error,Failed to parse #define, bad macro syntax \n " , toString (outputList));
699699}
700700
701701static void define_define_1 ()
@@ -1094,6 +1094,15 @@ static void define_va_opt_8()
10941094 ASSERT_EQUALS (" " , toString (outputList));
10951095}
10961096
1097+ static void define_va_opt_9 ()
1098+ {
1099+ simplecpp::DUI dui;
1100+ dui.defines .emplace_back (" f(...)=__VA_OPT__" );
1101+ simplecpp::OutputList outputList;
1102+ ASSERT_EQUALS (" " , preprocess (" " , dui, &outputList));
1103+ ASSERT_EQUALS (" file0,0,dui_error,In definition of 'f': Missing opening parenthesis for __VA_OPT__\n " , toString (outputList));
1104+ }
1105+
10971106static void define_ifdef ()
10981107{
10991108 const char code[] = " #define A(X) X\n "
@@ -3599,6 +3608,7 @@ int main(int argc, char **argv)
35993608 TEST_CASE (define_va_opt_6);
36003609 TEST_CASE (define_va_opt_7);
36013610 TEST_CASE (define_va_opt_8);
3611+ TEST_CASE (define_va_opt_9); // #632
36023612
36033613 TEST_CASE (pragma_backslash); // multiline pragma directive
36043614
0 commit comments