[libcxx-commits] [PATCH] D157569: Fixed issue #64544 ([libc++] std::rotl and std::rotr have the wrong signature)

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Aug 9 19:17:08 PDT 2023


philnik requested changes to this revision.
philnik added a comment.
This revision now requires changes to proceed.

Please add tests in `libcxx/test/std/numerics/bit/bitops.rot/rotr.pass.cpp` for this change.



================
Comment at: libcxx/include/__bit/rotate.h:50
+[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp rotr(_Tp __t, int __cnt) noexcept {
+  if (__cnt < 0)
+    return rotl(__t, -__cnt);
----------------
We might also want to fix `__rotr`, depending on where it is used. Generally, the underscore versions should have the same semantics as non-underscore versions.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157569/new/

https://reviews.llvm.org/D157569



More information about the libcxx-commits mailing list