From: Jonathan Wakely Date: Fri, 26 Jul 2019 13:36:44 +0000 (+0100) Subject: Remove std::byte overloads from X-Git-Tag: releases/gcc-9.2.0~107 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f3334246c2a84e53ad3ffdad221f7975c40da2e;p=thirdparty%2Fgcc.git Remove std::byte overloads from The additional overloads for std::byte in were reviewed by LEWG and considered undesirable, so this patch removes them. Backport from mainline (partial) 2019-06-26 Jonathan Wakely * include/std/bit (rotl(byte, unsigned), rotr(byte, unsigned)) (countl_zero(byte), countl_one(byte), countr_zero(byte)) (countr_one(byte), popcount(byte), ispow2(byte), ceil2(byte)) (floor2(byte), log2p1(byte)): Remove. * testsuite/26_numerics/bit/bit.pow.two/ceil2.cc: Remove test for std::byte overload. * testsuite/26_numerics/bit/bit.pow.two/floor2.cc: Likewise. * testsuite/26_numerics/bit/bit.pow.two/ispow2.cc: Likewise. * testsuite/26_numerics/bit/bit.pow.two/log2p1.cc: Likewise. * testsuite/26_numerics/bit/bitops.count/countl_one.cc: Likewise. * testsuite/26_numerics/bit/bitops.count/countl_zero.cc: Likewise. * testsuite/26_numerics/bit/bitops.count/countr_one.cc: Likewise. * testsuite/26_numerics/bit/bitops.count/countr_zero.cc: Likewise. * testsuite/26_numerics/bit/bitops.count/popcount.cc: Likewise. * testsuite/26_numerics/bit/bitops.rot/rotl.cc: Likewise. * testsuite/26_numerics/bit/bitops.rot/rotr.cc: Likewise. From-SVN: r273834 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index e68a43ccc6c4..d688eb8f9f9b 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,25 @@ +2019-07-26 Jonathan Wakely + + Backport from mainline (partial) + 2019-06-26 Jonathan Wakely + + * include/std/bit (rotl(byte, unsigned), rotr(byte, unsigned)) + (countl_zero(byte), countl_one(byte), countr_zero(byte)) + (countr_one(byte), popcount(byte), ispow2(byte), ceil2(byte)) + (floor2(byte), log2p1(byte)): Remove. + * testsuite/26_numerics/bit/bit.pow.two/ceil2.cc: Remove test for + std::byte overload. + * testsuite/26_numerics/bit/bit.pow.two/floor2.cc: Likewise. + * testsuite/26_numerics/bit/bit.pow.two/ispow2.cc: Likewise. + * testsuite/26_numerics/bit/bit.pow.two/log2p1.cc: Likewise. + * testsuite/26_numerics/bit/bitops.count/countl_one.cc: Likewise. + * testsuite/26_numerics/bit/bitops.count/countl_zero.cc: Likewise. + * testsuite/26_numerics/bit/bitops.count/countr_one.cc: Likewise. + * testsuite/26_numerics/bit/bitops.count/countr_zero.cc: Likewise. + * testsuite/26_numerics/bit/bitops.count/popcount.cc: Likewise. + * testsuite/26_numerics/bit/bitops.rot/rotl.cc: Likewise. + * testsuite/26_numerics/bit/bitops.rot/rotr.cc: Likewise. + 2019-07-26 Jonathan Wakely Backport from mainline diff --git a/libstdc++-v3/include/std/bit b/libstdc++-v3/include/std/bit index e0c53e537563..07eb868c8311 100644 --- a/libstdc++-v3/include/std/bit +++ b/libstdc++-v3/include/std/bit @@ -299,54 +299,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION log2p1(_Tp __x) noexcept { return std::__log2p1(__x); } -#if ! __STRICT_ANSI__ - enum class byte : unsigned char; - - constexpr byte - rotl(byte __x, unsigned int __s) noexcept - { return (byte)std::__rotl((unsigned char)__x, __s); } - - constexpr byte - rotr(byte __x, unsigned int __s) noexcept - { return (byte)std::__rotr((unsigned char)__x, __s); } - - constexpr int - countl_zero(byte __x) noexcept - { return std::__countl_zero((unsigned char)__x); } - - constexpr int - countl_one(byte __x) noexcept - { return std::__countl_one((unsigned char)__x); } - - constexpr int - countr_zero(byte __x) noexcept - { return std::__countr_zero((unsigned char)__x); } - - constexpr int - countr_one(byte __x) noexcept - { return std::__countr_one((unsigned char)__x); } - - constexpr int - popcount(byte __x) noexcept - { return std::__popcount((unsigned char)__x); } - - constexpr bool - ispow2(byte __x) noexcept - { return std::__ispow2((unsigned char)__x); } - - constexpr byte - ceil2(byte __x) noexcept - { return (byte)std::__ceil2((unsigned char)__x); } - - constexpr byte - floor2(byte __x) noexcept - { return (byte)std::__floor2((unsigned char)__x); } - - constexpr byte - log2p1(byte __x) noexcept - { return (byte)std::__log2p1((unsigned char)__x); } -#endif - #endif // C++2a _GLIBCXX_END_NAMESPACE_VERSION diff --git a/libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/ceil2.cc b/libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/ceil2.cc index 6ffb5f70edb9..84f3ac156c3f 100644 --- a/libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/ceil2.cc +++ b/libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/ceil2.cc @@ -86,18 +86,6 @@ static_assert( test( X{} ).did_not_match() ); enum E : unsigned { e }; static_assert( test( e ).did_not_match() ); -#ifndef __STRICT_ANSI__ -#include -static_assert( std::ceil2(std::byte{0}) == std::byte{1} ); -static_assert( std::ceil2(std::byte{1}) == std::byte{1} ); -static_assert( std::ceil2(std::byte{2}) == std::byte{2} ); -static_assert( std::ceil2(std::byte{3}) == std::byte{4} ); -static_assert( std::ceil2(std::byte{100}) == std::byte{128} ); -static_assert( std::ceil2(std::byte{128}) == std::byte{128} ); -#else -static_assert( test( (std::byte)0 ).did_not_match() ); -#endif - #if !defined(__STRICT_ANSI__) && defined _GLIBCXX_USE_INT128 static_assert( test( (unsigned __int128)0 ) ); static_assert( test( (__int128)0 ).did_not_match() ); @@ -114,3 +102,10 @@ static_assert( test( (__GLIBCXX_TYPE_INT_N_1)0 ).did_not_match() ); static_assert( test( (unsigned __GLIBCXX_TYPE_INT_N_2)0 ) ); static_assert( test( (__GLIBCXX_TYPE_INT_N_2)0 ).did_not_match() ); #endif +#if defined(__GLIBCXX_TYPE_INT_N_3) +static_assert( test( (unsigned __GLIBCXX_TYPE_INT_N_3)0 ) ); +static_assert( test( (__GLIBCXX_TYPE_INT_N_3)0 ).did_not_match() ); +#endif + +#include +static_assert( test( (std::byte)0 ).did_not_match() ); diff --git a/libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/floor2.cc b/libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/floor2.cc index a18f14ff9889..aff9138650eb 100644 --- a/libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/floor2.cc +++ b/libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/floor2.cc @@ -78,19 +78,6 @@ static_assert( test( X{} ).did_not_match() ); enum E : unsigned { e }; static_assert( test( e ).did_not_match() ); -#ifndef __STRICT_ANSI__ -#include -static_assert( std::floor2(std::byte{0}) == std::byte{0} ); -static_assert( std::floor2(std::byte{1}) == std::byte{1} ); -static_assert( std::floor2(std::byte{2}) == std::byte{2} ); -static_assert( std::floor2(std::byte{3}) == std::byte{2} ); -static_assert( std::floor2(std::byte{100}) == std::byte{64} ); -static_assert( std::floor2(std::byte{128}) == std::byte{128} ); -static_assert( std::floor2(std::byte{255}) == std::byte{128} ); -#else -static_assert( test( (std::byte)0 ).did_not_match() ); -#endif - #if !defined(__STRICT_ANSI__) && defined _GLIBCXX_USE_INT128 static_assert( test( (unsigned __int128)0 ) ); static_assert( test( (__int128)0 ).did_not_match() ); @@ -107,3 +94,6 @@ static_assert( test( (__GLIBCXX_TYPE_INT_N_1)0 ).did_not_match() ); static_assert( test( (unsigned __GLIBCXX_TYPE_INT_N_2)0 ) ); static_assert( test( (__GLIBCXX_TYPE_INT_N_2)0 ).did_not_match() ); #endif + +#include +static_assert( test( (std::byte)0 ).did_not_match() ); diff --git a/libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/ispow2.cc b/libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/ispow2.cc index 8ab8b7175040..869197627d4e 100644 --- a/libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/ispow2.cc +++ b/libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/ispow2.cc @@ -126,19 +126,6 @@ static_assert( test( X{} ).did_not_match() ); enum E : unsigned { e }; static_assert( test( e ).did_not_match() ); -#ifndef __STRICT_ANSI__ -#include -static_assert( std::ispow2(std::byte{0}) == false ); -static_assert( std::ispow2(std::byte{1}) == true ); -static_assert( std::ispow2(std::byte{2}) == true ); -static_assert( std::ispow2(std::byte{3}) == false ); -static_assert( std::ispow2(std::byte{100}) == false ); -static_assert( std::ispow2(std::byte{128}) == true ); -static_assert( std::ispow2(std::byte{255}) == false ); -#else -static_assert( test( (std::byte)0 ).did_not_match() ); -#endif - #if !defined(__STRICT_ANSI__) && defined _GLIBCXX_USE_INT128 static_assert( test( (unsigned __int128)0 ) ); static_assert( test( (__int128)0 ).did_not_match() ); @@ -155,3 +142,6 @@ static_assert( test( (__GLIBCXX_TYPE_INT_N_1)0 ).did_not_match() ); static_assert( test( (unsigned __GLIBCXX_TYPE_INT_N_2)0 ) ); static_assert( test( (__GLIBCXX_TYPE_INT_N_2)0 ).did_not_match() ); #endif + +#include +static_assert( test( (std::byte)0 ).did_not_match() ); diff --git a/libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/log2p1.cc b/libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/log2p1.cc index 0aa8a6c40f61..aeb5486b9092 100644 --- a/libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/log2p1.cc +++ b/libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/log2p1.cc @@ -78,19 +78,6 @@ static_assert( test( X{} ).did_not_match() ); enum E : unsigned { e }; static_assert( test( e ).did_not_match() ); -#ifndef __STRICT_ANSI__ -#include -static_assert( std::log2p1(std::byte{0}) == std::byte{0} ); -static_assert( std::log2p1(std::byte{1}) == std::byte{1} ); -static_assert( std::log2p1(std::byte{2}) == std::byte{2} ); -static_assert( std::log2p1(std::byte{3}) == std::byte{2} ); -static_assert( std::log2p1(std::byte{100}) == std::byte{7} ); -static_assert( std::log2p1(std::byte{128}) == std::byte{8} ); -static_assert( std::log2p1(std::byte{255}) == std::byte{8} ); -#else -static_assert( test( (std::byte)0 ).did_not_match() ); -#endif - #if !defined(__STRICT_ANSI__) && defined _GLIBCXX_USE_INT128 static_assert( test( (unsigned __int128)0 ) ); static_assert( test( (__int128)0 ).did_not_match() ); @@ -107,3 +94,6 @@ static_assert( test( (__GLIBCXX_TYPE_INT_N_1)0 ).did_not_match() ); static_assert( test( (unsigned __GLIBCXX_TYPE_INT_N_2)0 ) ); static_assert( test( (__GLIBCXX_TYPE_INT_N_2)0 ).did_not_match() ); #endif + +#include +static_assert( test( (std::byte)0 ).did_not_match() ); diff --git a/libstdc++-v3/testsuite/26_numerics/bit/bitops.count/countl_one.cc b/libstdc++-v3/testsuite/26_numerics/bit/bitops.count/countl_one.cc index 6fc634d55b58..50b681c00900 100644 --- a/libstdc++-v3/testsuite/26_numerics/bit/bitops.count/countl_one.cc +++ b/libstdc++-v3/testsuite/26_numerics/bit/bitops.count/countl_one.cc @@ -73,16 +73,6 @@ static_assert( test( X{} ).did_not_match() ); enum E : unsigned { e }; static_assert( test( e ).did_not_match() ); -#ifndef __STRICT_ANSI__ -#include -constexpr int bits = std::numeric_limits::digits; -static_assert( std::countl_one(std::byte{0}) == 0 ); -static_assert( std::countl_one(~std::byte{0}) == bits ); -static_assert( std::countl_one(~std::byte{0} ^ std::byte{7}) == bits - 3 ); -#else -static_assert( test( (std::byte)0 ).did_not_match() ); -#endif - #if !defined(__STRICT_ANSI__) && defined _GLIBCXX_USE_INT128 static_assert( test( (unsigned __int128)0 ) ); static_assert( test( (__int128)0 ).did_not_match() ); @@ -99,3 +89,6 @@ static_assert( test( (__GLIBCXX_TYPE_INT_N_1)0 ).did_not_match() ); static_assert( test( (unsigned __GLIBCXX_TYPE_INT_N_2)0 ) ); static_assert( test( (__GLIBCXX_TYPE_INT_N_2)0 ).did_not_match() ); #endif + +#include +static_assert( test( (std::byte)0 ).did_not_match() ); diff --git a/libstdc++-v3/testsuite/26_numerics/bit/bitops.count/countl_zero.cc b/libstdc++-v3/testsuite/26_numerics/bit/bitops.count/countl_zero.cc index 64049a32e0e4..8c8a13fed34e 100644 --- a/libstdc++-v3/testsuite/26_numerics/bit/bitops.count/countl_zero.cc +++ b/libstdc++-v3/testsuite/26_numerics/bit/bitops.count/countl_zero.cc @@ -70,20 +70,6 @@ static_assert( test( X{} ).did_not_match() ); enum E : unsigned { e }; static_assert( test( e ).did_not_match() ); -#ifndef __STRICT_ANSI__ -#include -constexpr int bits = std::numeric_limits::digits; -static_assert( std::countl_zero(std::byte{0}) == bits ); -static_assert( std::countl_zero(std::byte{0x01}) == bits - 1 ); -static_assert( std::countl_zero(std::byte{0x02}) == bits - 2 ); -static_assert( std::countl_zero(std::byte{0x03}) == bits - 2 ); -static_assert( std::countl_zero(std::byte{0x30}) == 2 ); -static_assert( std::countl_zero(std::byte{0x40}) == 1 ); -static_assert( std::countl_zero(std::byte{0x41}) == 1 ); -#else -static_assert( test( (std::byte)0 ).did_not_match() ); -#endif - #if !defined(__STRICT_ANSI__) && defined _GLIBCXX_USE_INT128 static_assert( test( (unsigned __int128)0 ) ); static_assert( test( (__int128)0 ).did_not_match() ); @@ -100,3 +86,6 @@ static_assert( test( (__GLIBCXX_TYPE_INT_N_1)0 ).did_not_match() ); static_assert( test( (unsigned __GLIBCXX_TYPE_INT_N_2)0 ) ); static_assert( test( (__GLIBCXX_TYPE_INT_N_2)0 ).did_not_match() ); #endif + +#include +static_assert( test( (std::byte)0 ).did_not_match() ); diff --git a/libstdc++-v3/testsuite/26_numerics/bit/bitops.count/countr_one.cc b/libstdc++-v3/testsuite/26_numerics/bit/bitops.count/countr_one.cc index 3218ef7b52d9..16c98579316e 100644 --- a/libstdc++-v3/testsuite/26_numerics/bit/bitops.count/countr_one.cc +++ b/libstdc++-v3/testsuite/26_numerics/bit/bitops.count/countr_one.cc @@ -72,20 +72,6 @@ static_assert( test( X{} ).did_not_match() ); enum E : unsigned { e }; static_assert( test( e ).did_not_match() ); -#ifndef __STRICT_ANSI__ -#include -constexpr int bits = std::numeric_limits::digits; -static_assert( std::countr_one(std::byte{0}) == 0 ); -static_assert( std::countr_one(std::byte{0x01}) == 1 ); -static_assert( std::countr_one(std::byte{0x02}) == 0 ); -static_assert( std::countr_one(std::byte{0x03}) == 2 ); -static_assert( std::countr_one(std::byte{0x30}) == 0 ); -static_assert( std::countr_one(std::byte{0x0f}) == 4 ); -static_assert( std::countr_one(std::byte{0xff}) == 8 ); -#else -static_assert( test( (std::byte)0 ).did_not_match() ); -#endif - #if !defined(__STRICT_ANSI__) && defined _GLIBCXX_USE_INT128 static_assert( test( (unsigned __int128)0 ) ); static_assert( test( (__int128)0 ).did_not_match() ); @@ -102,3 +88,6 @@ static_assert( test( (__GLIBCXX_TYPE_INT_N_1)0 ).did_not_match() ); static_assert( test( (unsigned __GLIBCXX_TYPE_INT_N_2)0 ) ); static_assert( test( (__GLIBCXX_TYPE_INT_N_2)0 ).did_not_match() ); #endif + +#include +static_assert( test( (std::byte)0 ).did_not_match() ); diff --git a/libstdc++-v3/testsuite/26_numerics/bit/bitops.count/countr_zero.cc b/libstdc++-v3/testsuite/26_numerics/bit/bitops.count/countr_zero.cc index 2f8505cb1fd1..0e1970b2af69 100644 --- a/libstdc++-v3/testsuite/26_numerics/bit/bitops.count/countr_zero.cc +++ b/libstdc++-v3/testsuite/26_numerics/bit/bitops.count/countr_zero.cc @@ -71,20 +71,6 @@ static_assert( test( X{} ).did_not_match() ); enum E : unsigned { e }; static_assert( test( e ).did_not_match() ); -#ifndef __STRICT_ANSI__ -#include -constexpr int bits = std::numeric_limits::digits; -static_assert( std::countr_zero(std::byte{0}) == bits ); -static_assert( std::countr_zero(std::byte{0x01}) == 0 ); -static_assert( std::countr_zero(std::byte{0x02}) == 1 ); -static_assert( std::countr_zero(std::byte{0x03}) == 0 ); -static_assert( std::countr_zero(std::byte{0x30}) == 4 ); -static_assert( std::countr_zero(std::byte{0x40}) == 6 ); -static_assert( std::countr_zero(std::byte{0x41}) == 0 ); -#else -static_assert( test( (std::byte)0 ).did_not_match() ); -#endif - #if !defined(__STRICT_ANSI__) && defined _GLIBCXX_USE_INT128 static_assert( test( (unsigned __int128)0 ) ); static_assert( test( (__int128)0 ).did_not_match() ); @@ -101,3 +87,6 @@ static_assert( test( (__GLIBCXX_TYPE_INT_N_1)0 ).did_not_match() ); static_assert( test( (unsigned __GLIBCXX_TYPE_INT_N_2)0 ) ); static_assert( test( (__GLIBCXX_TYPE_INT_N_2)0 ).did_not_match() ); #endif + +#include +static_assert( test( (std::byte)0 ).did_not_match() ); diff --git a/libstdc++-v3/testsuite/26_numerics/bit/bitops.count/popcount.cc b/libstdc++-v3/testsuite/26_numerics/bit/bitops.count/popcount.cc index aea16214beab..07b8c6ac4e25 100644 --- a/libstdc++-v3/testsuite/26_numerics/bit/bitops.count/popcount.cc +++ b/libstdc++-v3/testsuite/26_numerics/bit/bitops.count/popcount.cc @@ -74,20 +74,6 @@ static_assert( test( X{} ).did_not_match() ); enum E : unsigned { e }; static_assert( test( e ).did_not_match() ); -#ifndef __STRICT_ANSI__ -#include -static_assert( std::popcount(std::byte{0x00}) == 0 ); -static_assert( std::popcount(std::byte{0x01}) == 1 ); -static_assert( std::popcount(std::byte{0x02}) == 1 ); -static_assert( std::popcount(std::byte{0x03}) == 2 ); -static_assert( std::popcount(std::byte{0x30}) == 2 ); -static_assert( std::popcount(std::byte{0x40}) == 1 ); -static_assert( std::popcount(std::byte{0x41}) == 2 ); -static_assert( std::popcount(std::byte{0xff}) == 8 ); -#else -static_assert( test( (std::byte)0 ).did_not_match() ); -#endif - #if !defined(__STRICT_ANSI__) && defined _GLIBCXX_USE_INT128 static_assert( test( (unsigned __int128)0 ) ); static_assert( test( (__int128)0 ).did_not_match() ); @@ -104,3 +90,6 @@ static_assert( test( (__GLIBCXX_TYPE_INT_N_1)0 ).did_not_match() ); static_assert( test( (unsigned __GLIBCXX_TYPE_INT_N_2)0 ) ); static_assert( test( (__GLIBCXX_TYPE_INT_N_2)0 ).did_not_match() ); #endif + +#include +static_assert( test( (std::byte)0 ).did_not_match() ); diff --git a/libstdc++-v3/testsuite/26_numerics/bit/bitops.rot/rotl.cc b/libstdc++-v3/testsuite/26_numerics/bit/bitops.rot/rotl.cc index 94be65c3d138..2d97ae8c4657 100644 --- a/libstdc++-v3/testsuite/26_numerics/bit/bitops.rot/rotl.cc +++ b/libstdc++-v3/testsuite/26_numerics/bit/bitops.rot/rotl.cc @@ -86,19 +86,6 @@ static_assert( test( X{} ).did_not_match() ); enum E : unsigned { e }; static_assert( test( e ).did_not_match() ); -#ifndef __STRICT_ANSI__ -#include -static_assert( std::rotl(std::byte{0}, 4) == std::byte{0} ); -static_assert( std::rotl(std::byte{0x01}, 4) == std::byte{0x10} ); -static_assert( std::rotl(std::byte{0x02}, 3) == std::byte{0x10} ); -static_assert( std::rotl(std::byte{0x03}, 2) == std::byte{0x0c} ); -static_assert( std::rotl(std::byte{0x30}, 2) == std::byte{0xc0} ); -static_assert( std::rotl(std::byte{0x40}, 1) == std::byte{0x80} ); -static_assert( std::rotl(std::byte{0x41}, 9) == std::byte{0x82} ); -#else -static_assert( test( (std::byte)0 ).did_not_match() ); -#endif - #if !defined(__STRICT_ANSI__) && defined _GLIBCXX_USE_INT128 static_assert( test( (unsigned __int128)0 ) ); static_assert( test( (__int128)0 ).did_not_match() ); @@ -115,3 +102,6 @@ static_assert( test( (__GLIBCXX_TYPE_INT_N_1)0 ).did_not_match() ); static_assert( test( (unsigned __GLIBCXX_TYPE_INT_N_2)0 ) ); static_assert( test( (__GLIBCXX_TYPE_INT_N_2)0 ).did_not_match() ); #endif + +#include +static_assert( test( (std::byte)0 ).did_not_match() ); diff --git a/libstdc++-v3/testsuite/26_numerics/bit/bitops.rot/rotr.cc b/libstdc++-v3/testsuite/26_numerics/bit/bitops.rot/rotr.cc index 3f1539aadbb3..c41c24d816a5 100644 --- a/libstdc++-v3/testsuite/26_numerics/bit/bitops.rot/rotr.cc +++ b/libstdc++-v3/testsuite/26_numerics/bit/bitops.rot/rotr.cc @@ -88,19 +88,6 @@ static_assert( test( X{} ).did_not_match() ); enum E : unsigned { e }; static_assert( test( e ).did_not_match() ); -#ifndef __STRICT_ANSI__ -#include -static_assert( std::rotr(std::byte{0}, 4) == std::byte{0} ); -static_assert( std::rotr(std::byte{0x01}, 4) == std::byte{0x10} ); -static_assert( std::rotr(std::byte{0x02}, 3) == std::byte{0x40} ); -static_assert( std::rotr(std::byte{0x03}, 2) == std::byte{0xc0} ); -static_assert( std::rotr(std::byte{0x30}, 2) == std::byte{0x0c} ); -static_assert( std::rotr(std::byte{0x40}, 1) == std::byte{0x20} ); -static_assert( std::rotr(std::byte{0x41}, 9) == std::byte{0xa0} ); -#else -static_assert( test( (std::byte)0 ).did_not_match() ); -#endif - #if !defined(__STRICT_ANSI__) && defined _GLIBCXX_USE_INT128 static_assert( test( (unsigned __int128)0 ) ); static_assert( test( (__int128)0 ).did_not_match() ); @@ -117,3 +104,6 @@ static_assert( test( (__GLIBCXX_TYPE_INT_N_1)0 ).did_not_match() ); static_assert( test( (unsigned __GLIBCXX_TYPE_INT_N_2)0 ) ); static_assert( test( (__GLIBCXX_TYPE_INT_N_2)0 ).did_not_match() ); #endif + +#include +static_assert( test( (std::byte)0 ).did_not_match() );