<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/99684>99684</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
is_constant_evaluated can evaluate to false in array bound
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
efriedma-quic
</td>
</tr>
</table>
<pre>
```
#include <type_traits>
int z[1/(1-std::is_constant_evaluated())];
```
clang prints the following, which is extremely confusing:
```
<source>:2:7: warning: variable length arrays in C++ are a Clang extension [-Wvla-cxx-extension]
2 | int z[1/(1-std::is_constant_evaluated())];
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<source>:2:8: note: division by zero
2 | int z[1/(1-std::is_constant_evaluated())];
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<source>:2:5: warning: variable length array folded to constant array as an extension [-Wgnu-folding-constant]
2 | int z[1/(1-std::is_constant_evaluated())];
| ^
2 warnings generated.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVM2OozgQfpriUiICGwIcOJB05xX22DK4AK8cO2ub_PRhn31lkt4eRdOaOcxoLIsSLlfV99VnW3ivJkPUQrmD8iURS5ita2l0iuRRpP8sakh6K28tbLPHzF4g64BxZQa9SELg-3A70VtwQgUP_PW-Q5mA71DucmAHYHWe-iCBd8A75d8Ga3wQJrzRWehFBJLAamBNnOUL8N2jylPR9TtoYSY8OWWCxzATjlZre1FmArbHy6yGGZVHugZHR9I3HKwZFx_9vPs20XN2vvd2cQNFCrxjwLsKeIcX4cw9GM_CKdFrQk1mCjMK58TNozK4B7YDtkPhCAXuV4h0DWS8sgah3KV_nbVIh-s1_X85Ml0rI0Oo9vgrOobriNmgfP33R-NL4nVka2ygaKU6q5VGf8N3cvaz0h_C_SXs8mf0iudFksRg8QPcwyE8CvMs22SWNEYoM6Uf-3-vcqstH9eIffDxOJEhF-M3T-c3kS2XDW9EQm1esbzIC15tk7nN67GvWS3rclsRz5uiKhpeyrERvGpYnyeqZRkrsipv8po3vNiwrWRUlqOs6jovtz0UGR2F0hutz8eNdVOivF-obZptXSRa9KT9-ngwZuiCqxMYi2-Ja2NM2i-ThyLTygf_mSWooKn9bndwiCI8_qJKo9Ce4iW7q9TbxchkcbqdQzj52OfY9cOkwrz0m8EegR1ioYdJT87-TUMAdljheWCHO_xzy_4LAAD__wzwjKo">