-
Notifications
You must be signed in to change notification settings - Fork 15k
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 analyzer
Description
When compiling the minimal sample with any std flag (that i have tried) other than -std=c23
, we get the warning:
warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
This warning is not triggered for c23.
This regression was introduced somewhere between 14.0.0 and 15.0.0.
I have never worked with LLVM before, but i have decided to take a stab at solving the issue.
My initial hunch is that its related to the introduction of built in bools, as that seemed to be introduced in 15.0.0.
Minimal example
int test() {
if (1 << 5) {
return 0;
}
return 1;
}
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 analyzer