<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/79435>79435</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang is not triggering `-Wtautological-constant-compare` when using `-std=c23`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
pileghoff
</td>
</tr>
</table>
<pre>
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.
# Minimal example
[Godbolt](https://godbolt.org/z/hvdrbP19s)
```c
int test() {
if (1 << 5) {
return 0;
}
return 1;
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEU02v2zYQ_DXUZWGDpCzZOugQP8NFgQTooWjOK3ItsaFJg1xZff31Bf2V9BVFAMKkNfyYnZnFnN0YiHrR7EVzqHDmKab-4jyNUzydqiHa9_7rRAFMPF-cd2EEngjOLrgzesh4vniCxfEEGN4hs4WTxxGE3vGEDA4mvBJwcmSF7iDyRAl4wgCilavMVtQHo2vRSqHfYCEYiW9PLJiCC6OoPwl5EPIT3CfRyu8ImBiulPhJK1GePUM8gdBbUb-VobfAERCGGD1hAPQLvmegK_oZmXJBOc0EotmvvjLOHH0cnUG_MjFkxsCrUjwmEs2h8LzzuP3-Prn8ZAouQ4hcah1HSmThFBMYXa9_PPGf04nGRDm7GGDBDC5winY2ZCHHMy0TJYKBeCEKoDZruZaAwYJqyvJ_r_71rnugKyVYYvpG9u7S589_fIGBTjFREXyYXx5ZMs6SvemB3wgQMuMAyJCjvz4ldjnP9O9ndQ1fHnmgv26BeADN_pdoh-i5CKd3E_MlFz_1UejjeIfWMY1CH_8W-jhdbRp-U10WunuZfR_m_t8FBqbMQu9KmMR2_8gGuGL5TsHddGg-wACJeE4BpKhfH8X28Fw-UPVCX9iLQmX72nZ1hxX1aitbtVNNp6qpp07bTbs7WVNji2pbS9MSnvQgt4YM1pXrtdQbqXSjlOoatS5r2rRaa9kq3ezERtIZnV97fz0XQaqbyv2229RN5XEgn28tqrXxGEahdenW1Jf9q2Ees9hI7zLn7zewY0_9W9n-IZjFydJ7P8l6K2EpjT_n54Efm7Wak-8_GOp4moe1iWehj4XHY1pdUvyTDAt9vJWVhT7eKvsnAAD__wwmYXA">