@@ -3508,13 +3508,21 @@ static void readfile_no_eof_newline()
35083508 const char code[] = " \\\n " ;
35093509 simplecpp::OutputList outputList;
35103510 readfile (code, sizeof (code)-1 , {}, &outputList);
3511- ASSERT_EQUALS (" file0,1,portability_no_eof_newline,No newline at end of file.\n " , toString (outputList));
3511+ ASSERT_EQUALS (" file0,1,portability_no_eof_newline,No newline at end of file is undefined behavior in C.\n " , toString (outputList));
3512+ }
3513+ {
3514+ const char code[] = " \\\n " ;
3515+ simplecpp::DUI dui;
3516+ dui.std = " c++03" ;
3517+ simplecpp::OutputList outputList;
3518+ readfile (code, sizeof (code)-1 , dui, &outputList);
3519+ ASSERT_EQUALS (" " , toString (outputList));
35123520 }
35133521 {
35143522 const char code[] = " #define A" ;
35153523 simplecpp::OutputList outputList;
35163524 readfile (code, sizeof (code)-1 , {}, &outputList);
3517- ASSERT_EQUALS (" file0,1,portability_no_eof_newline,No newline at end of file.\n " , toString (outputList));
3525+ ASSERT_EQUALS (" file0,1,portability_no_eof_newline,No newline at end of file is undefined behavior in C .\n " , toString (outputList));
35183526 }
35193527 {
35203528 const char code[] = " #define A\n " ;
@@ -3526,13 +3534,13 @@ static void readfile_no_eof_newline()
35263534 const char code[] = " #define A\\ " ;
35273535 simplecpp::OutputList outputList;
35283536 readfile (code, sizeof (code)-1 , {}, &outputList);
3529- ASSERT_EQUALS (" file0,1,portability_no_eof_newline,No newline at end of file.\n " , toString (outputList));
3537+ ASSERT_EQUALS (" file0,1,portability_no_eof_newline,No newline at end of file is undefined behavior in C .\n " , toString (outputList));
35303538 }
35313539 {
35323540 const char code[] = " // comment" ;
35333541 simplecpp::OutputList outputList;
35343542 readfile (code, sizeof (code)-1 , {}, &outputList);
3535- ASSERT_EQUALS (" file0,1,portability_no_eof_newline,No newline at end of file.\n " , toString (outputList));
3543+ ASSERT_EQUALS (" file0,1,portability_no_eof_newline,No newline at end of file is undefined behavior in C .\n " , toString (outputList));
35363544 }
35373545 {
35383546 const char code[] = " // comment\n " ;
@@ -3544,7 +3552,7 @@ static void readfile_no_eof_newline()
35443552 const char code[] = " /* comment \n comment */" ;
35453553 simplecpp::OutputList outputList;
35463554 readfile (code, sizeof (code)-1 , {}, &outputList);
3547- ASSERT_EQUALS (" file0,2,portability_no_eof_newline,No newline at end of file.\n " , toString (outputList));
3555+ ASSERT_EQUALS (" file0,2,portability_no_eof_newline,No newline at end of file is undefined behavior in C .\n " , toString (outputList));
35483556 }
35493557 {
35503558 const char code[] = " /* comment \n comment */\n " ;
0 commit comments