Open
Description
Using the -traditional-cpp
flag (or invoking as cpp
directly), clang seems to be mis-parsing quotation marks inside C++-style comments.
Test code:
// Test "double
// Try 'single
Command:
$CC -traditional-cpp -E test.c | cat
(piping through cat
to separate stderr
from stdout
)
Output from clang
(Homebrew clang version 20.1.6)
(omitting line number directives)
test.c:1:9: warning: missing terminating '"' character [-Winvalid-pp-token]
1 | // Test "double
| ^
test.c:2:8: warning: missing terminating ' character [-Winvalid-pp-token]
2 | // Try 'single
| ^
2 warnings generated.
// Test "double
// Try 'single
The invalid-pp-token
warning seems to be bogus.
Output from GCC (clean output)
// Test "double
// Try 'single
Honestly, since this seems to be a small issue, I am personally fine with this becoming a wont fix or a FIXME
inside test/Preprocessor/traditional-cpp.c
.