diff --git a/stl/inc/__msvc_int128.hpp b/stl/inc/__msvc_int128.hpp index c1abd2979ac..80303533138 100644 --- a/stl/inc/__msvc_int128.hpp +++ b/stl/inc/__msvc_int128.hpp @@ -1420,109 +1420,6 @@ struct common_type<_Unsigned128, _Signed128> { using type = _Unsigned128; }; -inline namespace literals { - inline namespace _Int128_literals { - namespace _Int128_detail { - enum class _U128_parse_status : unsigned char { - _Valid, - _Overflow, - _Invalid, - }; - - struct _U128_parse_result { - _U128_parse_status _Status_code; - _Unsigned128 _Value; - }; - - _NODISCARD _CONSTEVAL unsigned int _Char_to_digit(const char _Ch) noexcept { - if (_Ch >= '0' && _Ch <= '9') { - return static_cast(_Ch - '0'); - } - - if (_Ch >= 'A' && _Ch <= 'F') { - return static_cast(_Ch - 'A' + 10); - } - - if (_Ch >= 'a' && _Ch <= 'f') { - return static_cast(_Ch - 'a' + 10); - } - - return static_cast(-1); - } - - template - struct _Parse_u128_impl { - _NODISCARD static _CONSTEVAL _U128_parse_result _Parse() noexcept { - if constexpr (sizeof...(_Chars) == 0) { - return {_U128_parse_status::_Valid, 0}; - } else { - constexpr char _Char_seq[]{_Chars...}; - constexpr auto _U128_max = (numeric_limits<_Unsigned128>::max)(); - - _Unsigned128 _Val{}; - for (const char _Ch : _Char_seq) { - if (_Ch == '\'') { - continue; - } - - const unsigned int _Digit = _Char_to_digit(_Ch); - if (_Digit == static_cast(-1)) { - return {_U128_parse_status::_Invalid, _Unsigned128{}}; - } - - if (_Val > _U128_max / _Base || _Base * _Val > _U128_max - _Digit) { - return {_U128_parse_status::_Overflow, _Unsigned128{}}; - } - - _Val = _Base * _Val + _Digit; - } - return {_U128_parse_status::_Valid, _Val}; - } - } - }; - - template - struct _Parse_u128 : _Parse_u128_impl<10, _Chars...> {}; - - template - struct _Parse_u128<'0', 'X', _Chars...> : _Parse_u128_impl<16, _Chars...> {}; - - template - struct _Parse_u128<'0', 'x', _Chars...> : _Parse_u128_impl<16, _Chars...> {}; - - template - struct _Parse_u128<'0', 'B', _Chars...> : _Parse_u128_impl<2, _Chars...> {}; - - template - struct _Parse_u128<'0', 'b', _Chars...> : _Parse_u128_impl<2, _Chars...> {}; - - template - struct _Parse_u128<'0', _Chars...> : _Parse_u128_impl<8, _Chars...> {}; - } // namespace _Int128_detail - - template - _NODISCARD _CONSTEVAL _Unsigned128 operator"" __u128() noexcept { - constexpr auto _Parsed_result = _Int128_detail::_Parse_u128<_Chars...>::_Parse(); - static_assert(_Parsed_result._Status_code != _Int128_detail::_U128_parse_status::_Invalid, - "Invalid characters in the integer literal"); - static_assert(_Parsed_result._Status_code != _Int128_detail::_U128_parse_status::_Overflow, - "The integer literal is too large for an unsigned 128-bit number"); - return _Parsed_result._Value; - } - - template - _NODISCARD _CONSTEVAL _Signed128 operator"" __i128() noexcept { - constexpr auto _Parsed_result = _Int128_detail::_Parse_u128<_Chars...>::_Parse(); - static_assert(_Parsed_result._Status_code != _Int128_detail::_U128_parse_status::_Invalid, - "Invalid characters in the integer literal"); - static_assert(_Parsed_result._Status_code != _Int128_detail::_U128_parse_status::_Overflow - && _Parsed_result._Value._Word[1] < (static_cast(1) << 63), - "The integer literal is too large for a signed 128-bit number"); - return static_cast<_Signed128>(_Parsed_result._Value); - } - } // namespace _Int128_literals -} // namespace literals - #undef _STL_128_INTRINSICS #undef _STL_128_DIV_INTRINSICS diff --git a/tests/std/tests/P1522R1_difference_type/test.cpp b/tests/std/tests/P1522R1_difference_type/test.cpp index 0a841903966..1a1ca5fde9d 100644 --- a/tests/std/tests/P1522R1_difference_type/test.cpp +++ b/tests/std/tests/P1522R1_difference_type/test.cpp @@ -35,9 +35,122 @@ namespace ordtest { #define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__) +#if _HAS_CXX20 +#define CONSTEVAL consteval +#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv +#define CONSTEVAL constexpr +#endif // ^^^ !_HAS_CXX20 ^^^ + +#if _HAS_CXX20 && !defined(__clang__) // TRANSITION, LLVM-51840 +#define CONSTEVAL_CLANG_WORKAROUND consteval +#else // ^^^ _HAS_CXX20 && !defined(__clang__) / !_HAS_CXX20 || defined(__clang__) vvv +#define CONSTEVAL_CLANG_WORKAROUND constexpr +#endif // ^^^ !_HAS_CXX20 || defined(__clang__) ^^^ + using std::_Signed128; using std::_Unsigned128; -using namespace std::literals::_Int128_literals; + +namespace i128_udl_detail { + enum class u128_parse_status : unsigned char { + valid, + overflow, + invalid, + }; + + struct u128_parse_result { + u128_parse_status status_code; + _Unsigned128 value; + }; + + [[nodiscard]] CONSTEVAL_CLANG_WORKAROUND unsigned int char_to_digit(const char c) noexcept { + if (c >= '0' && c <= '9') { + return static_cast(c - '0'); + } + + if (c >= 'A' && c <= 'F') { + return static_cast(c - 'A' + 10); + } + + if (c >= 'a' && c <= 'f') { + return static_cast(c - 'a' + 10); + } + + return static_cast(-1); + } + + template + struct parse_u128_impl { + [[nodiscard]] static CONSTEVAL u128_parse_result parse() noexcept { + constexpr char char_seq[]{Chars...}; + constexpr auto u128_max = std::numeric_limits<_Unsigned128>::max(); + + _Unsigned128 val{}; + for (const char c : char_seq) { + if (c == '\'') { + continue; + } + + const unsigned int digit = char_to_digit(c); + if (digit == static_cast(-1)) { + return {u128_parse_status::invalid, _Unsigned128{}}; + } + + if (val > u128_max / Base || Base * val > u128_max - digit) { + return {u128_parse_status::overflow, _Unsigned128{}}; + } + + val = Base * val + digit; + } + return {u128_parse_status::valid, val}; + } + }; + + template + struct parse_u128_impl { + [[nodiscard]] static CONSTEVAL u128_parse_result parse() noexcept { + return {u128_parse_status::valid, 0}; + } + }; + + template + struct parse_u128 : parse_u128_impl<10, Chars...> {}; + + template + struct parse_u128<'0', 'X', Chars...> : parse_u128_impl<16, Chars...> {}; + + template + struct parse_u128<'0', 'x', Chars...> : parse_u128_impl<16, Chars...> {}; + + template + struct parse_u128<'0', 'B', Chars...> : parse_u128_impl<2, Chars...> {}; + + template + struct parse_u128<'0', 'b', Chars...> : parse_u128_impl<2, Chars...> {}; + + template + struct parse_u128<'0', Chars...> : parse_u128_impl<8, Chars...> {}; +} // namespace i128_udl_detail + +template +[[nodiscard]] CONSTEVAL _Unsigned128 operator"" _u128() noexcept { + constexpr auto parsed_result = i128_udl_detail::parse_u128::parse(); + static_assert(parsed_result.status_code != i128_udl_detail::u128_parse_status::invalid, + "Invalid characters in the integer literal"); + static_assert(parsed_result.status_code != i128_udl_detail::u128_parse_status::overflow, + "The integer literal is too large for an unsigned 128-bit number"); + return parsed_result.value; +} + +template +[[nodiscard]] CONSTEVAL _Signed128 operator"" _i128() noexcept { + constexpr auto parsed_result = i128_udl_detail::parse_u128::parse(); + static_assert(parsed_result.status_code != i128_udl_detail::u128_parse_status::invalid, + "Invalid characters in the integer literal"); + static_assert(parsed_result.status_code != i128_udl_detail::u128_parse_status::overflow + && parsed_result.value._Word[1] < (static_cast(1) << 63), + "The integer literal is too large for a signed 128-bit number"); + return static_cast<_Signed128>(parsed_result.value); +} template constexpr void check_equal(const I& x) { @@ -149,14 +262,14 @@ constexpr bool test_unsigned() { check_equal(_Unsigned128{42}); check_equal(_Unsigned128{-42}); check_equal(_Unsigned128{0x11111111'11111111, 0x22222222'22222222}); - check_equal(0x22222222'22222222'11111111'11111111__u128); + check_equal(0x22222222'22222222'11111111'11111111_u128); check_order(_Unsigned128{42}, _Unsigned128{-42}, ordtest::strong_ordering::less); check_order(_Unsigned128{0, 42}, _Unsigned128{0, 52}, ordtest::strong_ordering::less); // ordered only by MSW check_order(_Unsigned128{42}, _Unsigned128{52}, ordtest::strong_ordering::less); // ordered only by LSW check_order(_Unsigned128{0x11111111'11111111, 0x22222222'22222222}, _Unsigned128{0x01010101'01010101, 0x01010101'01010101}, ordtest::strong_ordering::greater); - check_order(0x22222222'22222222'11111111'11111111__u128, 0x01010101'01010101'01010101'01010101__u128, + check_order(0x22222222'22222222'11111111'11111111_u128, 0x01010101'01010101'01010101'01010101_u128, ordtest::strong_ordering::greater); { @@ -220,7 +333,7 @@ constexpr bool test_unsigned() { product = _Unsigned128{0x01010101'01010101, 0x01010101'01010101} * 5; assert(product._Word[0] == 0x05050505'05050505); assert(product._Word[1] == 0x05050505'05050505); - assert(product == 0x05050505'05050505'05050505'05050505__u128); + assert(product == 0x05050505'05050505'05050505'05050505_u128); product = 5 * _Unsigned128{0x01010101'01010101, 0x01010101'01010101}; assert(product._Word[0] == 0x05050505'05050505); @@ -230,7 +343,7 @@ constexpr bool test_unsigned() { product *= product; assert(product._Word[0] == 0x08070605'04030201); assert(product._Word[1] == 0x100f0e0d'0c0b0a09); - assert(product == 0x100f0e0d'0c0b0a09'08070605'04030201__u128); + assert(product == 0x100f0e0d'0c0b0a09'08070605'04030201_u128); assert(+product == product); assert(-product + product == 0); @@ -238,21 +351,21 @@ constexpr bool test_unsigned() { * _Unsigned128{0x000f0e0d'0c0b0a09, 0x08070605'04030201}; assert(product._Word[0] == 0x6dc18e55'16d48f48); assert(product._Word[1] == 0xdc1b6bce'43cd6c21); - assert(product == 0xdc1b6bce'43cd6c21'6dc18e55'16d48f48__u128); + assert(product == 0xdc1b6bce'43cd6c21'6dc18e55'16d48f48_u128); assert(+product == product); assert(-product + product == 0); product <<= 11; assert(product._Word[0] == 0x0c72a8b6'a47a4000); assert(product._Word[1] == 0xdb5e721e'6b610b6e); - assert(product == 0xdb5e721e'6b610b6e'0c72a8b6'a47a4000__u128); + assert(product == 0xdb5e721e'6b610b6e'0c72a8b6'a47a4000_u128); assert(+product == product); assert(-product + product == 0); product >>= 17; assert(product._Word[0] == 0x85b70639'545b523d); assert(product._Word[1] == 0x00006daf'390f35b0); - assert(product == 0x00006daf'390f35b0'85b70639'545b523d__u128); + assert(product == 0x00006daf'390f35b0'85b70639'545b523d_u128); assert(+product == product); assert(-product + product == 0); } @@ -269,7 +382,7 @@ constexpr bool test_unsigned() { q = _Unsigned128{0x01010101'01010101, 0x01010101'01010101} / _Unsigned128{13}; assert(q._Word[0] == 0xc50013c5'0013c500); assert(q._Word[1] == 0x0013c500'13c50013); - assert(q == 0x0013c500'13c50013'c50013c5'0013c500__u128); + assert(q == 0x0013c500'13c50013'c50013c5'0013c500_u128); q = _Unsigned128{0x22222222'22222222, 0x22222222'22222222} / _Unsigned128{0x11111111'11111111, 0x11111111'11111111}; @@ -319,19 +432,19 @@ constexpr bool test_unsigned() { const _Unsigned128 x{0x01020304'02030405, 0x03040506'04050607}; const _Unsigned128 y{0x07060504'06050403, 0x05040302'04030101}; assert(((x & y) == _Unsigned128{0x01020104'02010401, 0x01040102'04010001})); - assert(((x & y) == 0x01040102'04010001'01020104'02010401__u128)); + assert(((x & y) == 0x01040102'04010001'01020104'02010401_u128)); auto tmp = x; tmp &= y; assert(tmp == (x & y)); assert(((x | y) == _Unsigned128{0x07060704'06070407, 0x07040706'04070707})); - assert(((x | y) == 0x07040706'04070707'07060704'06070407__u128)); + assert(((x | y) == 0x07040706'04070707'07060704'06070407_u128)); tmp = x; tmp |= y; assert(tmp == (x | y)); assert(((x ^ y) == _Unsigned128{0x06040600'04060006, 0x06000604'00060706})); - assert(((x ^ y) == 0x06000604'00060706'06040600'04060006__u128)); + assert(((x ^ y) == 0x06000604'00060706'06040600'04060006_u128)); tmp = x; tmp ^= y; assert(tmp == (x ^ y)); @@ -369,41 +482,41 @@ constexpr bool test_unsigned() { assert(x._Word[1] == static_cast(std::numeric_limits::max())); } { - STATIC_ASSERT(noexcept(0__u128)); - STATIC_ASSERT(noexcept(42__u128)); - STATIC_ASSERT(noexcept(4'2__u128)); - STATIC_ASSERT(noexcept(052__u128)); - STATIC_ASSERT(noexcept(05'2__u128)); - STATIC_ASSERT(noexcept(0x2a__u128)); - STATIC_ASSERT(noexcept(0X2a__u128)); - STATIC_ASSERT(noexcept(0x2A__u128)); - STATIC_ASSERT(noexcept(0X2A__u128)); - STATIC_ASSERT(noexcept(0x2'A__u128)); - STATIC_ASSERT(noexcept(0b101010__u128)); - STATIC_ASSERT(noexcept(0b1'0101'0__u128)); - STATIC_ASSERT(noexcept(0B101010__u128)); - STATIC_ASSERT(noexcept(0B1'0101'0__u128)); - STATIC_ASSERT(noexcept(0xABCDEF__u128)); - STATIC_ASSERT(noexcept(340282366920938463463374607431768211455__u128)); - STATIC_ASSERT(noexcept(0xffffffff'FFFFFFFF'ffffFFFF'FFFFffff__u128)); - - STATIC_ASSERT(42__u128 == 42); - STATIC_ASSERT(4'2__u128 == 42); - STATIC_ASSERT(42__u128 == 052__u128); - STATIC_ASSERT(4'2__u128 == 052__u128); - STATIC_ASSERT(42__u128 == 0x2a__u128); - STATIC_ASSERT(4'2__u128 == 0X2a__u128); - STATIC_ASSERT(42__u128 == 0b101010__u128); - STATIC_ASSERT(4'2__u128 == 0b101010__u128); - STATIC_ASSERT(42__u128 == 0B101010__u128); - STATIC_ASSERT(4'2__u128 == 0B101010__u128); - STATIC_ASSERT(11259375__u128 == 0xABCDEF__u128); + STATIC_ASSERT(noexcept(0_u128)); + STATIC_ASSERT(noexcept(42_u128)); + STATIC_ASSERT(noexcept(4'2_u128)); + STATIC_ASSERT(noexcept(052_u128)); + STATIC_ASSERT(noexcept(05'2_u128)); + STATIC_ASSERT(noexcept(0x2a_u128)); + STATIC_ASSERT(noexcept(0X2a_u128)); + STATIC_ASSERT(noexcept(0x2A_u128)); + STATIC_ASSERT(noexcept(0X2A_u128)); + STATIC_ASSERT(noexcept(0x2'A_u128)); + STATIC_ASSERT(noexcept(0b101010_u128)); + STATIC_ASSERT(noexcept(0b1'0101'0_u128)); + STATIC_ASSERT(noexcept(0B101010_u128)); + STATIC_ASSERT(noexcept(0B1'0101'0_u128)); + STATIC_ASSERT(noexcept(0xABCDEF_u128)); + STATIC_ASSERT(noexcept(340282366920938463463374607431768211455_u128)); + STATIC_ASSERT(noexcept(0xffffffff'FFFFFFFF'ffffFFFF'FFFFffff_u128)); + + STATIC_ASSERT(42_u128 == 42); + STATIC_ASSERT(4'2_u128 == 42); + STATIC_ASSERT(42_u128 == 052_u128); + STATIC_ASSERT(4'2_u128 == 052_u128); + STATIC_ASSERT(42_u128 == 0x2a_u128); + STATIC_ASSERT(4'2_u128 == 0X2a_u128); + STATIC_ASSERT(42_u128 == 0b101010_u128); + STATIC_ASSERT(4'2_u128 == 0b101010_u128); + STATIC_ASSERT(42_u128 == 0B101010_u128); + STATIC_ASSERT(4'2_u128 == 0B101010_u128); + STATIC_ASSERT(11259375_u128 == 0xABCDEF_u128); STATIC_ASSERT( - 340'2823'6692'0938'4634'6337'4607'4317'6821'1455__u128 == 0xffffffff'FFFFFFFF'ffffFFFF'FFFFffff__u128); + 340'2823'6692'0938'4634'6337'4607'4317'6821'1455_u128 == 0xffffffff'FFFFFFFF'ffffFFFF'FFFFffff_u128); STATIC_ASSERT( - 340'282'366'920'938'463'463'374'607'431'768'211'455__u128 == std::numeric_limits<_Unsigned128>::max()); - STATIC_ASSERT(0xffffffff'ffffffff'ffffffff'ffffffff__u128 == std::numeric_limits<_Unsigned128>::max()); + 340'282'366'920'938'463'463'374'607'431'768'211'455_u128 == std::numeric_limits<_Unsigned128>::max()); + STATIC_ASSERT(0xffffffff'ffffffff'ffffffff'ffffffff_u128 == std::numeric_limits<_Unsigned128>::max()); } return true; @@ -482,12 +595,12 @@ constexpr bool test_signed() { check_equal(_Signed128{42}); check_equal(_Signed128{-42}); check_equal(_Signed128{0x11111111'11111111, 0x22222222'22222222}); - check_equal(0x22222222'22222222'11111111'11111111__i128); + check_equal(0x22222222'22222222'11111111'11111111_i128); check_order(_Signed128{42}, _Signed128{-42}, ordtest::strong_ordering::greater); check_order(_Signed128{0x11111111'11111111, 0x22222222'22222222}, _Signed128{0x01010101'01010101, 0x01010101'01010101}, ordtest::strong_ordering::greater); - check_order(0x22222222'22222222'11111111'11111111__i128, 0x01010101'01010101'01010101'01010101__i128, + check_order(0x22222222'22222222'11111111'11111111_i128, 0x01010101'01010101'01010101'01010101_i128, ordtest::strong_ordering::greater); check_order(_Signed128{~0ull, ~0ull}, _Signed128{-1}, ordtest::strong_ordering::equal); @@ -613,19 +726,19 @@ constexpr bool test_signed() { } { auto product = _Signed128{0x01010101'01010101, 0x01010101'01010101} * 5; - assert(product == 0x05050505'05050505'05050505'05050505__i128); + assert(product == 0x05050505'05050505'05050505'05050505_i128); assert(product._Word[0] == 0x05050505'05050505); assert(product._Word[1] == 0x05050505'05050505); product = 5 * _Signed128{0x01010101'01010101, 0x01010101'01010101}; - assert(product == 0x05050505'05050505'05050505'05050505__i128); + assert(product == 0x05050505'05050505'05050505'05050505_i128); assert(product._Word[0] == 0x05050505'05050505); assert(product._Word[1] == 0x05050505'05050505); } { auto product = _Signed128{0x01010101'01010101, 0x01010101'01010101}; product *= product; - assert(product == 0x100f0e0d'0c0b0a09'08070605'04030201__i128); + assert(product == 0x100f0e0d'0c0b0a09'08070605'04030201_i128); assert(product._Word[0] == 0x08070605'04030201); assert(product._Word[1] == 0x100f0e0d'0c0b0a09); assert(+product == product); @@ -634,21 +747,21 @@ constexpr bool test_signed() { { auto product = _Signed128{0x01020304'05060708, 0x090a0b0c'0d0e0f00} * _Signed128{0x000f0e0d'0c0b0a09, 0x08070605'04030201}; - assert(product == -0x23e49431'bc3293de'923e71aa'e92b70b8__i128); + assert(product == -0x23e49431'bc3293de'923e71aa'e92b70b8_i128); assert(product._Word[0] == 0x6dc18e55'16d48f48); assert(product._Word[1] == 0xdc1b6bce'43cd6c21); assert(+product == product); assert(-product + product == 0); product <<= 11; - assert(product == -0x24a18de1'949ef491'f38d5749'5b85c000__i128); + assert(product == -0x24a18de1'949ef491'f38d5749'5b85c000_i128); assert(product._Word[0] == 0x0c72a8b6'a47a4000); assert(product._Word[1] == 0xdb5e721e'6b610b6e); assert(+product == product); assert(-product + product == 0); product >>= 17; - assert(product == -0x00001250'c6f0ca4f'7a48f9c6'aba4adc3__i128); + assert(product == -0x00001250'c6f0ca4f'7a48f9c6'aba4adc3_i128); assert(product._Word[0] == 0x85b70639'545b523d); assert(product._Word[1] == 0xffffedaf'390f35b0); assert(+product == product); @@ -688,7 +801,7 @@ constexpr bool test_signed() { assert(q._Word[1] == 0); q = _Signed128{0x01010101'01010101, 0x01010101'01010101} / _Signed128{13}; - assert(q == 0x0013c500'13c50013'c50013c5'0013c500__i128); + assert(q == 0x0013c500'13c50013'c50013c5'0013c500_i128); assert(q._Word[0] == 0xc50013c5'0013c500); assert(q._Word[1] == 0x0013c500'13c50013); @@ -781,19 +894,19 @@ constexpr bool test_signed() { const _Signed128 x{0x01020304'02030405, 0x03040506'04050607}; const _Signed128 y{0x07060504'06050403, 0x05040302'04030101}; assert(((x & y) == _Signed128{0x01020104'02010401, 0x01040102'04010001})); - assert(((x & y) == 0x01040102'04010001'01020104'02010401__i128)); + assert(((x & y) == 0x01040102'04010001'01020104'02010401_i128)); auto tmp = x; tmp &= y; assert(tmp == (x & y)); assert(((x | y) == _Signed128{0x07060704'06070407, 0x07040706'04070707})); - assert(((x | y) == 0x07040706'04070707'07060704'06070407__i128)); + assert(((x | y) == 0x07040706'04070707'07060704'06070407_i128)); tmp = x; tmp |= y; assert(tmp == (x | y)); assert(((x ^ y) == _Signed128{0x06040600'04060006, 0x06000604'00060706})); - assert(((x ^ y) == 0x06000604'00060706'06040600'04060006__i128)); + assert(((x ^ y) == 0x06000604'00060706'06040600'04060006_i128)); tmp = x; tmp ^= y; assert(tmp == (x ^ y)); @@ -831,45 +944,45 @@ constexpr bool test_signed() { assert(x == std::numeric_limits<_Signed128>::max()); } { - STATIC_ASSERT(noexcept(0__i128)); - STATIC_ASSERT(noexcept(42__i128)); - STATIC_ASSERT(noexcept(4'2__i128)); - STATIC_ASSERT(noexcept(052__i128)); - STATIC_ASSERT(noexcept(05'2__i128)); - STATIC_ASSERT(noexcept(0x2a__i128)); - STATIC_ASSERT(noexcept(0X2a__i128)); - STATIC_ASSERT(noexcept(0x2A__i128)); - STATIC_ASSERT(noexcept(0X2A__i128)); - STATIC_ASSERT(noexcept(0x2'A__i128)); - STATIC_ASSERT(noexcept(0b101010__i128)); - STATIC_ASSERT(noexcept(0b1'0101'0__i128)); - STATIC_ASSERT(noexcept(0B101010__i128)); - STATIC_ASSERT(noexcept(0B1'0101'0__i128)); - STATIC_ASSERT(noexcept(0xABCDEF__i128)); - STATIC_ASSERT(noexcept(170141183460469231731687303715884105727__i128)); - STATIC_ASSERT(noexcept(0x7fffffff'FFFFFFFF'ffffFFFF'FFFFffff__i128)); - - STATIC_ASSERT(42__i128 == 42); - STATIC_ASSERT(4'2__i128 == 42); - STATIC_ASSERT(42__i128 == 052__i128); - STATIC_ASSERT(4'2__i128 == 052__i128); - STATIC_ASSERT(42__i128 == 0x2a__i128); - STATIC_ASSERT(4'2__i128 == 0X2a__i128); - STATIC_ASSERT(42__i128 == 0b101010__i128); - STATIC_ASSERT(4'2__i128 == 0b101010__i128); - STATIC_ASSERT(42__i128 == 0B101010__i128); - STATIC_ASSERT(4'2__i128 == 0B101010__i128); - STATIC_ASSERT(11259375__i128 == 0xABCDEF__i128); + STATIC_ASSERT(noexcept(0_i128)); + STATIC_ASSERT(noexcept(42_i128)); + STATIC_ASSERT(noexcept(4'2_i128)); + STATIC_ASSERT(noexcept(052_i128)); + STATIC_ASSERT(noexcept(05'2_i128)); + STATIC_ASSERT(noexcept(0x2a_i128)); + STATIC_ASSERT(noexcept(0X2a_i128)); + STATIC_ASSERT(noexcept(0x2A_i128)); + STATIC_ASSERT(noexcept(0X2A_i128)); + STATIC_ASSERT(noexcept(0x2'A_i128)); + STATIC_ASSERT(noexcept(0b101010_i128)); + STATIC_ASSERT(noexcept(0b1'0101'0_i128)); + STATIC_ASSERT(noexcept(0B101010_i128)); + STATIC_ASSERT(noexcept(0B1'0101'0_i128)); + STATIC_ASSERT(noexcept(0xABCDEF_i128)); + STATIC_ASSERT(noexcept(170141183460469231731687303715884105727_i128)); + STATIC_ASSERT(noexcept(0x7fffffff'FFFFFFFF'ffffFFFF'FFFFffff_i128)); + + STATIC_ASSERT(42_i128 == 42); + STATIC_ASSERT(4'2_i128 == 42); + STATIC_ASSERT(42_i128 == 052_i128); + STATIC_ASSERT(4'2_i128 == 052_i128); + STATIC_ASSERT(42_i128 == 0x2a_i128); + STATIC_ASSERT(4'2_i128 == 0X2a_i128); + STATIC_ASSERT(42_i128 == 0b101010_i128); + STATIC_ASSERT(4'2_i128 == 0b101010_i128); + STATIC_ASSERT(42_i128 == 0B101010_i128); + STATIC_ASSERT(4'2_i128 == 0B101010_i128); + STATIC_ASSERT(11259375_i128 == 0xABCDEF_i128); STATIC_ASSERT( - 170'1411'8346'0469'2317'3168'7303'7158'8410'5727__i128 == 0x7fffffff'FFFFFFFF'ffffFFFF'FFFFffff__i128); + 170'1411'8346'0469'2317'3168'7303'7158'8410'5727_i128 == 0x7fffffff'FFFFFFFF'ffffFFFF'FFFFffff_i128); STATIC_ASSERT( - 170'141'183'460'469'231'731'687'303'715'884'105'727__i128 == std::numeric_limits<_Signed128>::max()); - STATIC_ASSERT(0x7fffffff'ffffffff'ffffffff'ffffffff__i128 == std::numeric_limits<_Signed128>::max()); + 170'141'183'460'469'231'731'687'303'715'884'105'727_i128 == std::numeric_limits<_Signed128>::max()); + STATIC_ASSERT(0x7fffffff'ffffffff'ffffffff'ffffffff_i128 == std::numeric_limits<_Signed128>::max()); STATIC_ASSERT( - -170'141'183'460'469'231'731'687'303'715'884'105'727__i128 - 1 == std::numeric_limits<_Signed128>::min()); - STATIC_ASSERT(-0x7fffffff'ffffffff'ffffffff'ffffffff__i128 - 1 == std::numeric_limits<_Signed128>::min()); + -170'141'183'460'469'231'731'687'303'715'884'105'727_i128 - 1 == std::numeric_limits<_Signed128>::min()); + STATIC_ASSERT(-0x7fffffff'ffffffff'ffffffff'ffffffff_i128 - 1 == std::numeric_limits<_Signed128>::min()); } return true;