diff options
author | Jakub Jelinek <jakub@redhat.com> | 2021-11-17 17:31:40 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2021-11-17 17:31:40 +0100 |
commit | 049f0efeaa77b43a508172161ca040feb6bb5622 (patch) | |
tree | ede32552574c9f51489803abf5e0add7258ca92d /gcc | |
parent | dd159a4167ca19b5ff26e7156333c88e854943bf (diff) | |
download | gcc-049f0efeaa77b43a508172161ca040feb6bb5622.zip gcc-049f0efeaa77b43a508172161ca040feb6bb5622.tar.gz gcc-049f0efeaa77b43a508172161ca040feb6bb5622.tar.bz2 |
libcpp: Fix up handling of block comments in -fdirectives-only mode [PR103130]
Normal preprocessing, -fdirectives-only preprocessing before the Nathan's
rewrite, and all other compilers I've tried on godbolt treat even \*/
as end of a block comment, but the new -fdirectives-only handling doesn't.
2021-11-17 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/103130
* lex.c (cpp_directive_only_process): Treat even \*/ as end of block
comment.
* c-c++-common/cpp/dir-only-9.c: New test.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/c-c++-common/cpp/dir-only-9.c | 13 |
1 files changed, 13 insertions, 0 deletions
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 0000000..d11cd97 --- /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; +} |