@@ -3480,13 +3480,21 @@ static void readfile_no_eof_newline()
34803480 const char code[] = " \\\n " ;
34813481 simplecpp::OutputList outputList;
34823482 readfile (code, sizeof (code)-1 , {}, &outputList);
3483- ASSERT_EQUALS (" file0,1,portability_no_eof_newline,No newline at end of file.\n " , toString (outputList));
3483+ ASSERT_EQUALS (" file0,1,portability_no_eof_newline,No newline at end of file is undefined behavior in C.\n " , toString (outputList));
3484+ }
3485+ {
3486+ const char code[] = " \\\n " ;
3487+ simplecpp::DUI dui;
3488+ dui.std = " c++03" ;
3489+ simplecpp::OutputList outputList;
3490+ readfile (code, sizeof (code)-1 , dui, &outputList);
3491+ ASSERT_EQUALS (" " , toString (outputList));
34843492 }
34853493 {
34863494 const char code[] = " #define A" ;
34873495 simplecpp::OutputList outputList;
34883496 readfile (code, sizeof (code)-1 , {}, &outputList);
3489- ASSERT_EQUALS (" file0,1,portability_no_eof_newline,No newline at end of file.\n " , toString (outputList));
3497+ ASSERT_EQUALS (" file0,1,portability_no_eof_newline,No newline at end of file is undefined behavior in C .\n " , toString (outputList));
34903498 }
34913499 {
34923500 const char code[] = " #define A\n " ;
@@ -3498,13 +3506,13 @@ static void readfile_no_eof_newline()
34983506 const char code[] = " #define A\\ " ;
34993507 simplecpp::OutputList outputList;
35003508 readfile (code, sizeof (code)-1 , {}, &outputList);
3501- ASSERT_EQUALS (" file0,1,portability_no_eof_newline,No newline at end of file.\n " , toString (outputList));
3509+ ASSERT_EQUALS (" file0,1,portability_no_eof_newline,No newline at end of file is undefined behavior in C .\n " , toString (outputList));
35023510 }
35033511 {
35043512 const char code[] = " // comment" ;
35053513 simplecpp::OutputList outputList;
35063514 readfile (code, sizeof (code)-1 , {}, &outputList);
3507- ASSERT_EQUALS (" file0,1,portability_no_eof_newline,No newline at end of file.\n " , toString (outputList));
3515+ ASSERT_EQUALS (" file0,1,portability_no_eof_newline,No newline at end of file is undefined behavior in C .\n " , toString (outputList));
35083516 }
35093517 {
35103518 const char code[] = " // comment\n " ;
@@ -3516,7 +3524,7 @@ static void readfile_no_eof_newline()
35163524 const char code[] = " /* comment \n comment */" ;
35173525 simplecpp::OutputList outputList;
35183526 readfile (code, sizeof (code)-1 , {}, &outputList);
3519- ASSERT_EQUALS (" file0,2,portability_no_eof_newline,No newline at end of file.\n " , toString (outputList));
3527+ ASSERT_EQUALS (" file0,2,portability_no_eof_newline,No newline at end of file is undefined behavior in C .\n " , toString (outputList));
35203528 }
35213529 {
35223530 const char code[] = " /* comment \n comment */\n " ;
0 commit comments