<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/130808>130808</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Conversion of inf to integer is not diagnosed
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
apolukhin
</td>
</tr>
</table>
<pre>
Consider the following example:
```cpp
int foo() {
return 1 / static_cast<double>(0);
}
```
With `-Wall -Wextra` there is no warning about an undefined behavior ([conv.fpint] p1 "The behavior is undefined if the truncated value cannot be represented in the destination type.")
Please add a warning
Godbolt playground: https://godbolt.org/z/cMYo6xPaY
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxcksFu2zAMhp-GvhAJZDlOnIMPaTvvNKCHAUVPA23RtjZFMiQ6bff0g5IWLQYQ0IE_yY-_SCnZyTO3UN9B_VDQKnOILS3BrX9m64s-mLf2PvhkDUeUmXEMzoUX6yfkVzovjqE6gbrGXt1iWBZQJ-sFxxBAN6CPCIc7UCdExMiyRo8lgu4wCYkdfg2UBKp7E9Y-N_wGulGgj1DlIjg8fO3-PkydnqzMCHu1eSLncPPErxIJ9ipjRkab0Ad8oegzLPVhFSSPqzc8Ws8Ge57pYkPEjFjfDcFftuNivUD9gEvm0z9n_pTZ9KXYjlc3JK5-IGGDF3Ir40DeB8GeMfISObHPOeuvYsNJrCexwaO8LbwFrfOW120eHVNiJGOQPqhvme_B9MEJLo7ephhWb6A64SyypOy97kB3002zDXEC3f0F3Q0_nsP-9ZGeC9NW5lgdqeC2POzKQ7mvd8dibg_7pi7Lw9Eoqga9ZyrLkRSPuj5o049U2FYrXauqLMtGHVWzVWocauKGyt1uLPUOdorPZN3Wucs5zy5sSiu3ZaUa1RSOenbp47Zim1Wbfp0S7JSzSdJnnVhxnA_twjFlf8KI1o8oAa0Xnjje_lPQWJp8SGyKNbr2PxeszGu_HcIZdJd7vz-bJYbfPAjo7gqYQHfvjJdW_wsAAP__76H3GQ">