From 049f0efeaa77b43a508172161ca040feb6bb5622 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 17 Nov 2021 17:31:40 +0100 Subject: 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 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. --- libcpp/lex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libcpp') diff --git a/libcpp/lex.c b/libcpp/lex.c index 6a4fbce..8188e33 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; -- cgit v1.1