Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion stl/inc/cstddef
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -86,7 +92,7 @@ _EXPORT_STD constexpr byte& operator^=(byte& _Left, const byte _Right) noexcept
}

_EXPORT_STD template <class _IntType, enable_if_t<is_integral_v<_IntType>, 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
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions stl/inc/utility
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ _CONSTEXPR20 _Ty exchange(_Ty& _Val, _Other&& _New_val) noexcept(
}

_EXPORT_STD template <class _Ty>
_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;
}

Expand Down Expand Up @@ -917,7 +917,7 @@ inline constexpr bool _Can_reference<_Ty, void_t<_Ty&>> = true;

#if _HAS_CXX23
_EXPORT_STD template <class _Ty>
_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<underlying_type_t<_Ty>>(_Value);
}

Expand Down
7 changes: 5 additions & 2 deletions stl/inc/xutility
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2667,7 +2669,7 @@ namespace ranges {
concept constant_range = input_range<_Rng> && _Constant_iterator<iterator_t<_Rng>>;

template <input_range _Rng>
_NODISCARD constexpr auto& _Possibly_const_range(_Rng& _Range) noexcept {
_NODISCARD _MSVC_INTRINSIC constexpr auto& _Possibly_const_range(_Rng& _Range) noexcept {
if constexpr (constant_range<const _Rng> && !constant_range<_Rng>) {
return _STD as_const(_Range);
} else {
Expand All @@ -2676,7 +2678,7 @@ namespace ranges {
}

template <class _Ty>
_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
Expand Down Expand Up @@ -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")
Expand Down