-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang: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 analyzer
Description
Bugzilla Link | 38571 |
Version | trunk |
OS | Linux |
CC | @gburgessiv,@lalozano,@m-gupta,@stephenhines |
Extended Description
void foo(int x) {
if (x && 5) {}
if (5 && x) {}
}
The above produces -Wconstant-logical-operand for the first statement, but not the second.
This was observed while compiling the Linux kernel, as a single translation unit has a mix of which side the constant logical operand is on, but only some of the conditionals producing warnings. In these cases, the constant logical operand is nested a few macros deep.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang: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 analyzer