<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/121676>121676</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-tidy] readability-use-std-min-max changes the type of the resulting expression
</td>
</tr>
<tr>
<th>Labels</th>
<td>
bug,
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
LegalizeAdulthood
</td>
</tr>
</table>
<pre>
Suppose you have this code:
```
#include <cstdint>
using U16 = std::uint16_t;
U16 f(U16 i)
{
if (i < 16U)
{
i = 16U;
}
return i;
}
```
The check replaces it with this code:
```
#include <algorithm>
#include <cstdint>
using U16 = std::uint16_t;
U16 f(U16 i)
{
i = std::max<unsigned int>(i, 16U);
return i;
}
```
The expected replacement is:
```
#include <algorithm>
#include <cstdint>
using U16 = std::uint16_t;
U16 f(U16 i)
{
i = std::max<U16>(i, 16U);
return i;
}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzUk8-O2yAQxp8GX5AjM9iOc_Ahu2lOvbV7rjBM7GnxH5lhm_TpKzvubvdQaXupVAkJNPPxDfMDTAjUDoi1KB5EcUpM5G6c64_YGk8_8Oii524cXdKM7lZ_itM0BpS3McrOPKPkjoK0o0OhjyJbR5ltIzsK0DRYHx1KoR9tYEcDC_3hroyBhlY-qVIKfZKB3eKhj5EGVuUXFvrhrlsUFwHVMpOAwxLdLzkppaSLFFDR4i9V-XRPL4lXySpbaywC_fAiOG2rGTnOg6St4hp_00Z2_NyhtB3ab3LGyRuLQRLL78TdXyEwvh1n4q7fIPwDPm839-Yq9GMc1kt3cisHFQl44Xcn9E4oeJ3QMrpfXHocWFL4f1g8qfJPCN7xNBJXa3fQB5Ngrfa6zHKtdJV0daEOYFQDzjqscl1cSshtcWiggKpyeZVQDRkUmcqKDBSoapeXmarKQ7PP7SXXuRV5hr0hv_P-ud-Nc5tQCBFrBarcl4k3DfqwfluAJrYCQMCjALDeDG3K5G5LqDglc704pE1sg8gzT4HDqycT-_Xz_7atOMkZjTMNeeJbGgOmgV3a05D25iptZ4YWg-QOJd8mlONlXc8YouflnvA6zRgCjUMSZ193zNP6IuAs4NwSd7HZ2bEXcF7OsU3pNI9f0bKA89poEHDeen2u4WcAAAD__zi_UzU">