<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/110522>110522</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-tidy] False negative readability-redundant-casting with std::max
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
chrchr-github
</td>
</tr>
</table>
<pre>
~~~c++
#include <algorithm>
template<typename>
double f(double d) {
return (double)d; // warning
}
double g(double d) {
return (double)f<int>(1.0); // warning
}
double h(double d) {
return (double)std::max(d, 1.0); // FN
}
~~~
https://godbolt.org/z/cb6d1EjKe
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUksFu3CAQhp9mfEFe4WGxw8GH7G58qdR3wMBiIoxXgDfdHvzslV0rTdNLIyEYwcz_MaNfpuRsMKYFfgJ-KeSchym2aohqiKV1eZj7op_0o12WRQGe1kUvQJ8BmQvKz9oQYGfp7RRdHkZgL_v7tmcz3rzMBtg5P24myNG8Z-hp7r0hV8CnPdSAgkCzEwghJJo8x0DeUwCFBnYigB1gR95kDC7Yndhc_hK2XxS-Aju7kNf_4VN1oIDif1HDF1Epa2DPwJ5H-WO9BzyTf4jd90-wZVl-B0POt7QKbIl20v3k82GKFrD7CdipvtbVy-s3U-iWacGELExbNdg0FRW8LoaWUy5qylH3lWIV5aIXijeMNlXzVAt2LVyLFI9UMFrxI7L6IK68ZtRQdlQNcnGFIzWjdP7g_X1c2YVLaTZtVVGOWHjZG582WyEqL4Mts9MPQFxtFtu1quxnm-BIvUs5_dHJLvvNkB_K-IV00idDgrEyu7sh0Ugte-ddfpTR6DloGXKpZMouWPLm8kA-TrmYo28_zW1z90FNI2C30vejvMXp1agM2G0tJcBu7-re4q8AAAD__1Ql8l4">