diff --git a/stl/inc/__msvc_int128.hpp b/stl/inc/__msvc_int128.hpp index 8740686ae2a..c1abd2979ac 100644 --- a/stl/inc/__msvc_int128.hpp +++ b/stl/inc/__msvc_int128.hpp @@ -1026,22 +1026,6 @@ class numeric_limits<_Unsigned128> : public _Num_int_base { static constexpr int digits10 = 38; }; -#ifdef __cpp_lib_concepts -template -struct common_type<_Ty, _Unsigned128> { - using type = _Unsigned128; -}; -template -struct common_type<_Unsigned128, _Ty> { - using type = _Unsigned128; -}; -#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv -template -struct common_type<_Ty, _Unsigned128> : enable_if, _Unsigned128> {}; -template -struct common_type<_Unsigned128, _Ty> : enable_if, _Unsigned128> {}; -#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ - struct _Signed128 : _Base128 { using _Signed_type = _Signed128; using _Unsigned_type = _Unsigned128; @@ -1427,22 +1411,6 @@ class numeric_limits<_Signed128> : public _Num_int_base { static constexpr int digits10 = 38; }; -#ifdef __cpp_lib_concepts -template -struct common_type<_Ty, _Signed128> { - using type = _Signed128; -}; -template -struct common_type<_Signed128, _Ty> { - using type = _Signed128; -}; -#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv -template -struct common_type<_Ty, _Signed128> : enable_if, _Signed128> {}; -template -struct common_type<_Signed128, _Ty> : enable_if, _Signed128> {}; -#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ - template <> struct common_type<_Signed128, _Unsigned128> { using type = _Unsigned128; diff --git a/tests/std/tests/P1522R1_difference_type/test.cpp b/tests/std/tests/P1522R1_difference_type/test.cpp index 3a0cb740e2e..01ce6919739 100644 --- a/tests/std/tests/P1522R1_difference_type/test.cpp +++ b/tests/std/tests/P1522R1_difference_type/test.cpp @@ -125,6 +125,18 @@ constexpr bool test_unsigned() { STATIC_ASSERT(SAME_AS, _Unsigned128>); STATIC_ASSERT(SAME_AS, _Unsigned128>); + struct ConversionSource { + constexpr operator _Unsigned128() const { + return _Unsigned128{}; + } + }; + STATIC_ASSERT(SAME_AS, _Unsigned128>); + + struct ConversionTarget { + constexpr ConversionTarget(_Unsigned128) {} + }; + STATIC_ASSERT(SAME_AS, ConversionTarget>); + #ifdef __cpp_lib_concepts // TRANSITION, GH-395 STATIC_ASSERT(std::_Integer_class<_Unsigned128>); STATIC_ASSERT(std::_Integer_like<_Unsigned128>); @@ -446,6 +458,18 @@ constexpr bool test_signed() { STATIC_ASSERT(SAME_AS, _Signed128>); STATIC_ASSERT(SAME_AS, _Signed128>); + struct ConversionSource { + constexpr operator _Signed128() const { + return _Signed128{}; + } + }; + STATIC_ASSERT(SAME_AS, _Signed128>); + + struct ConversionTarget { + constexpr ConversionTarget(_Signed128) {} + }; + STATIC_ASSERT(SAME_AS, ConversionTarget>); + #ifdef __cpp_lib_concepts // TRANSITION, GH-395 STATIC_ASSERT(std::_Integer_class<_Signed128>); STATIC_ASSERT(std::_Integer_like<_Signed128>);