diff --git a/gcc/testsuite/c-c++-common/cpp/dir-only-9.c b/gcc/testsuite/c-c++-common/cpp/dir-only-9.c new file mode 100644 index 00000000000..d11cd97cb71 --- /dev/null +++ b/gcc/testsuite/c-c++-common/cpp/dir-only-9.c @@ -0,0 +1,13 @@ +/* PR preprocessor/103130 */ +/* { dg-do preprocess } */ +/* { dg-options -fdirectives-only } */ + +/*\ + * this is a comment +\*/ + +int +main () +{ + return 0; +} diff --git a/libcpp/lex.c b/libcpp/lex.c index 6a4fbce6030..8188e33b07d 100644 --- a/libcpp/lex.c +++ b/libcpp/lex.c @@ -4891,7 +4891,7 @@ cpp_directive_only_process (cpp_reader *pfile, break; case '*': - if (pos > peek && !esc) + if (pos > peek) star = is_block; esc = false; break;