[llvm-bugs] [Bug 49017] New: preprocessor fails to resolve directives in keepComments mode
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Feb 3 05:50:10 PST 2021
https://bugs.llvm.org/show_bug.cgi?id=49017
Bug ID: 49017
Summary: preprocessor fails to resolve directives in
keepComments mode
Product: clang
Version: 11.0
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: Frontend
Assignee: unassignedclangbugs at nondot.org
Reporter: jquante at web.de
CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
richard-llvm at metafoo.co.uk
When running clang preprocessor with -C option (keep comments), preprocessor
directives that come after a comment are not resolved.
Example:
/* xxx */ #define X 1
int z=X;
clang -E -C keeps the entire code as it is, while clang -E correctly produces:
int z=1;
I would expect the following result:
/* xxx */
int z=1;
As far as I could debug this issue, it seems that pp. directives are only
recognized when the # is the first token on a line. Comments are not considered
for this (first token) criterion - a comment is a token in -C mode - but should
be ignored.
The same behavior occurs in clang 10 and 11.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210203/4b42c0cc/attachment-0001.html>
More information about the llvm-bugs
mailing list