-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Open
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerconfirmedVerified by a second partyVerified by a second party
Description
Background
This issue is filed based on a suggestion by @Endilll during a code review.
The current diagnostic for a top-level comma in a preprocessor expression is not very actionable, as it points to the end of the line instead of the problematic token.
Current Behavior
Given the following code:
#if 1, 2
#endifClang currently produces a diagnostic like this:
<stdin>:1:6: error: expected end of line in preprocessor expression
1 | #if 1, 2
| ^
<stdin>:1:2: error: unterminated conditional directive
1 | #if 1, 2
| ^A better diagnostic would be more directly that commas should not be included. Rather than just indicating EOL.
Metadata
Metadata
Assignees
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerconfirmedVerified by a second partyVerified by a second party