<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64544>64544</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc++] std::rotl and std::rotr have the wrong signature
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
derekmauro
</td>
</tr>
</table>
<pre>
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0553r3.html
https://en.cppreference.com/w/cpp/numeric/rotl
https://en.cppreference.com/w/cpp/numeric/rotr
According to all documentation I see, the second argument to `std::rotl` and `std::rott` should be `int`, and defines the behavior when the argument is negative. However, `libc++` uses `unsigned int`:
https://github.com/llvm/llvm-project/blob/211c9752c8200fbb3ff7be1f6aa98037901758ce/libcxx/include/__bit/rotate.h#L37
https://github.com/llvm/llvm-project/blob/211c9752c8200fbb3ff7be1f6aa98037901758ce/libcxx/include/__bit/rotate.h#L45
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMU01v3CoU_TV4g2LBxXg8Cy8mL7Lek95_iPi4tkkZsADPpP--wknbpLuqm0qjsTlcn_t1jsrZLQFxJPKRyKdG7WWNabSY8MtV7Sk2Otqv41rKlom4EJgITPf7vY0bhodcbBvTQmB6KYYTmLIBqAEL1JONJhOYNrVhqi_A-FDPTEqRRLuWqyfsibDLZ3oMrdm2hDMmDAZbE6-Vk8Bkto3AFPYrJmcITCmWP2dIbwxv_xdjYrIuLLREqrynNpr9iqGo4mKg_9GMSOAfWlakGU0Mlqq0HBH1C9KzXGytQ1yO4npGVbC_4qXieY27t1RjvXWhYpW5hlucXcB8ZNG4qpuLid5XDAfyI6HLNOCiirthS_-Nd7xhqhSkZ95pQ-Cx_npG94y5ons4tm3pezpx-dj75xkurqy7fh-d97fvj4ctxRc0hcCkfdR1rZyb80mCGYCxWWsxzyeNfO6VOg9MnM6Mn-RgsBI4bV5fCUwuGL_bCj0_a1feNqEKtisB8b84_W0VdbKxo7BncVYNjrw_cwmd4KJZxx47LoTlEhiKbtaIzA5Dbzk3JyV017gRGAg2sIGfJZei7WoxPcph7pTQWpCO4VU539ZuqqEal_OOY9_Jrmu80ujzYVCAgHd6XBKA6tc0HhPQ-5JJx7zLJf9kKa74w9kf1CCf6CeFHnr7iCS6qhseQrunGBZaJaPKnrDZkx9_eyVHtdX9RzffAgAA__8DG2UM">