Closed
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