diff --git a/stl/inc/cstddef b/stl/inc/cstddef index 91aa28020..756b2316b 100644 --- a/stl/inc/cstddef +++ b/stl/inc/cstddef @@ -19,6 +19,12 @@ _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("new") #undef new +// TRANSITION, non-_Ugly attribute tokens +#pragma push_macro("msvc") +#pragma push_macro("intrinsic") +#undef msvc +#undef intrinsic + _STD_BEGIN _EXPORT_STD using _CSTD ptrdiff_t; _EXPORT_STD using _CSTD size_t; @@ -86,7 +92,7 @@ _EXPORT_STD constexpr byte& operator^=(byte& _Left, const byte _Right) noexcept } _EXPORT_STD template , int> = 0> -_NODISCARD constexpr _IntType to_integer(const byte _Arg) noexcept { +_NODISCARD _MSVC_INTRINSIC constexpr _IntType to_integer(const byte _Arg) noexcept { return static_cast<_IntType>(_Arg); } #endif // __cpp_lib_byte @@ -95,6 +101,10 @@ _STD_END using _STD max_align_t; // intentional, for historical reasons +// TRANSITION, non-_Ugly attribute tokens +#pragma pop_macro("intrinsic") +#pragma pop_macro("msvc") + #pragma pop_macro("new") _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) diff --git a/stl/inc/utility b/stl/inc/utility index 18f21aced..f853436f7 100644 --- a/stl/inc/utility +++ b/stl/inc/utility @@ -766,7 +766,7 @@ _CONSTEXPR20 _Ty exchange(_Ty& _Val, _Other&& _New_val) noexcept( } _EXPORT_STD template -_NODISCARD constexpr add_const_t<_Ty>& as_const(_Ty& _Val) noexcept { // view _Val through const lenses +_NODISCARD _MSVC_INTRINSIC constexpr add_const_t<_Ty>& as_const(_Ty& _Val) noexcept { // view _Val through const lenses return _Val; } @@ -917,7 +917,7 @@ inline constexpr bool _Can_reference<_Ty, void_t<_Ty&>> = true; #if _HAS_CXX23 _EXPORT_STD template -_NODISCARD constexpr underlying_type_t<_Ty> to_underlying(_Ty _Value) noexcept { +_NODISCARD _MSVC_INTRINSIC constexpr underlying_type_t<_Ty> to_underlying(_Ty _Value) noexcept { return static_cast>(_Value); } diff --git a/stl/inc/xutility b/stl/inc/xutility index a4312e1ba..60ea3b5a3 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -23,7 +23,9 @@ _STL_DISABLE_CLANG_WARNINGS // TRANSITION, non-_Ugly attribute tokens #pragma push_macro("msvc") +#pragma push_macro("intrinsic") #undef msvc +#undef intrinsic #if defined(_CRTBLD) && defined(CRTDLL2) // TRANSITION, ABI: The vector algorithms are compiled into the import lib, so we disable their usage when building @@ -2667,7 +2669,7 @@ namespace ranges { concept constant_range = input_range<_Rng> && _Constant_iterator>; template - _NODISCARD constexpr auto& _Possibly_const_range(_Rng& _Range) noexcept { + _NODISCARD _MSVC_INTRINSIC constexpr auto& _Possibly_const_range(_Rng& _Range) noexcept { if constexpr (constant_range && !constant_range<_Rng>) { return _STD as_const(_Range); } else { @@ -2676,7 +2678,7 @@ namespace ranges { } template - _NODISCARD constexpr auto _As_const_pointer(const _Ty* _Ptr) noexcept { + _NODISCARD _MSVC_INTRINSIC constexpr auto _As_const_pointer(const _Ty* _Ptr) noexcept { return _Ptr; } #endif // _HAS_CXX23 @@ -7239,6 +7241,7 @@ _NODISCARD constexpr bool _Mul_overflow(const _Int _Left, const _Int _Right, _In _STD_END // TRANSITION, non-_Ugly attribute tokens +#pragma pop_macro("intrinsic") #pragma pop_macro("msvc") #pragma pop_macro("new")