Adjust std::rotl, std::rotr etc to match final P0553R4 proposal
authorJonathan Wakely <jwakely@redhat.com>
Mon, 22 Jul 2019 16:53:36 +0000 (17:53 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 22 Jul 2019 16:53:36 +0000 (17:53 +0100)
commitf35da524a26d82cb1aa4a71ce48f92c64d506658
tree151353c32171fc0dc81dedc048464a67cf0a03b6
parent281ab2fbff7398643352e86fcddc83098efd6310
Adjust std::rotl, std::rotr etc to match final P0553R4 proposal

This proposal has now been accepted for C++20, with a few changes. This
patch adjusts std::rotl and std::rotr to match the final specification
and declares the additions for C++2a mode even when __STRICT_ANSI__ is
defined.

* include/std/bit (__rotl, __rotr): Change second parameter from
unsigned int to int and handle negative values.
(rotl, rotr): Remove check for __STRICT_ANSI__. Change second
parameter from unsigned int to int. Add nodiscard attribute.
* testsuite/26_numerics/bit/bitops.rot/rotl.cc: Rename to ...
* testsuite/26_numerics/bit/bit.rotate/rotl.cc: Here. Test negative
shifts.
* testsuite/26_numerics/bit/bitops.rot/rotr.cc: Rename to ...
* testsuite/26_numerics/bit/bit.rotate/rotr.cc: Here. Test negative
shifts.

From-SVN: r273706
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/bit
libstdc++-v3/testsuite/26_numerics/bit/bit.rotate/rotl.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/bit/bit.rotate/rotr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/bit/bitops.rot/rotl.cc [deleted file]
libstdc++-v3/testsuite/26_numerics/bit/bitops.rot/rotr.cc [deleted file]