<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/155364>155364</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc++] __desugars_to_v doesn't recognize `const` arguments, leading to missed optimizations
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc++,
performance
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
philnik777
</td>
</tr>
</table>
<pre>
A simple example is
```c++
auto test(int* first, int* last, const int* first2) {
return std::equal(first, last, first2, std::less<int>());
}
```
`less<int>` doesn't get recognized here simply because the second pointer argument is `const`. We should fix that.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxUkstu8zgMRp9G3hANFPoie-FF2kxeYZaBbDG2ZmTLI9JF26cfKL3lBwjInyEdSIe0zH5aiXpVP6v6XNhd5pj6bfZh9f8aY4ohuvf-BOyXLRDQm72vnpU-qUZ_1qjwOZc-2V0iCLEobP0qCk9w8ynHF_jKwX7GMa4s8LgJFXagTOYAJJI9rcDiVHlS5Yn-221Q2P7gvjnfR19-9wZiVuVLZpd_KWwVdrnKTFbm_Hj1_H2Pf55pNLhIvCo0AhMJJBrjtPoPcjBTok8f7zDQaHcmkJmAaYyrgy36VSiBTdO-0CrgGbKj_FzV6AP8TcBz3IODm38Dma0c8osL15euKztbUH80dXPsygpNMffH1hjsqhadG6rbsSwrXeNAjTk2uq5bXfgeNda6xUabUqM5mMbeBtPVbihb67BTlabF-nAI4XU5xDQVnnmn_ljXZVMVwQ4U-D4CiMEP3-3EbFUhbpRuMS12HSn_q89F6jPpadgnVpUOnoV_2eIl3AfqAVWf4Xp1xPtkE18lXl8f_P64ffT044_vzSbr_DqBRFg8MzmIm_jFf1jxceViT6GfRTbOA4AXhZfJy7wPhzEuCi_5bl_L05biPzSKwstdAiu8fHl47fH_AAAA__8IIvN-">