- Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed
Labels
c23clang: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 analyzerregression
Description
Basic programs involving constant comparisons produce -Wconstant-logical-operand with -std=c2x but not with -std=c17.
This program shouldn't produced -Wconstant-logical-operand because my understanding is that's for using boolean operations with integer operands, but these should both be booleans.
This is happening only in trunk and the clang 17 release, neither one produces the warning in clang 16.
(This program is reduced from a program with a constant sizeof comparison that was failing.)
int main(int argc, const char **argv) { if ((1 == 1) && (argc == 1)) return 1; return 0; }Godbolt link demonstrating the regression: https://godbolt.org/z/e15rEc6r9
Metadata
Metadata
Assignees
Labels
c23clang: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 analyzerregression