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
3 changes: 2 additions & 1 deletion stl/inc/__msvc_int128.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <cstdint>
#include _STL_INTRIN_HEADER
#include <limits>
#include <type_traits>

#include _STL_INTRIN_HEADER

#if _HAS_CXX20
#include <bit>
#include <compare>
Expand Down
3 changes: 2 additions & 1 deletion stl/inc/bit
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
_EMIT_STL_WARNING(STL4038, "The contents of <bit> are available only with C++20 or later.");
#else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv

#include _STL_INTRIN_HEADER
#include <isa_availability.h>
#include <limits>
#include <type_traits>

#include _STL_INTRIN_HEADER

#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
Expand Down
3 changes: 2 additions & 1 deletion stl/inc/charconv
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
_EMIT_STL_WARNING(STL4038, "The contents of <charconv> are available only with C++17 or later.");
#else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv
#include <cstring>
#include _STL_INTRIN_HEADER
#include <xbit_ops.h>
#include <xcharconv.h>
#include <xcharconv_ryu.h>
#include <xcharconv_tables.h>
#include <xutility>

#include _STL_INTRIN_HEADER

#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
Expand Down
3 changes: 2 additions & 1 deletion stl/inc/limits
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
#include <cfloat>
#include <climits>
#include <cwchar>
#include _STL_INTRIN_HEADER
#include <isa_availability.h>
#include <xstddef>

#include _STL_INTRIN_HEADER

// TRANSITION, GH-2129, move down to _Arm64_popcount
#if (defined(_M_ARM64) || defined(_M_ARM64EC)) && !defined(_M_CEE_PURE) && !defined(__CUDACC__) \
&& !defined(__INTEL_COMPILER) && !defined(__clang__) // TRANSITION, LLVM-51488
Expand Down
6 changes: 3 additions & 3 deletions stl/inc/memory_resource
Original file line number Diff line number Diff line change
Expand Up @@ -576,18 +576,18 @@ namespace pmr {

void release() noexcept /* strengthened */ {
lock_guard<mutex> _Guard{_Mtx};
this->unsynchronized_pool_resource::release();
unsynchronized_pool_resource::release();
}

protected:
void* do_allocate(const size_t _Bytes, const size_t _Align) override {
lock_guard<mutex> _Guard{_Mtx};
return this->unsynchronized_pool_resource::do_allocate(_Bytes, _Align);
return unsynchronized_pool_resource::do_allocate(_Bytes, _Align);
}

void do_deallocate(void* const _Ptr, const size_t _Bytes, const size_t _Align) override {
lock_guard<mutex> _Guard{_Mtx};
this->unsynchronized_pool_resource::do_deallocate(_Ptr, _Bytes, _Align);
unsynchronized_pool_resource::do_deallocate(_Ptr, _Bytes, _Align);
}

private:
Expand Down
22 changes: 11 additions & 11 deletions stl/inc/ranges
Original file line number Diff line number Diff line change
Expand Up @@ -3549,6 +3549,17 @@ namespace ranges {
_EXPORT_STD inline constexpr _Drop_while_fn drop_while;
} // namespace views

#ifdef __clang__
template <class _Rng> // TRANSITION, LLVM-47414
concept _Can_const_join = forward_range<const _Rng> && is_reference_v<range_reference_t<const _Rng>>
&& input_range<range_reference_t<const _Rng>>;
#endif // ^^^ workaround ^^^

template <class _Ty>
_NODISCARD constexpr _Ty& _As_lvalue(_Ty&& _Val) noexcept {
return static_cast<_Ty&>(_Val);
}

_EXPORT_STD template <input_range _Vw>
requires view<_Vw> && input_range<range_reference_t<_Vw>>
class join_view;
Expand All @@ -3569,17 +3580,6 @@ namespace ranges {
/* [[no_unique_address]] */ _Non_propagating_cache<_Cache_wrapper, false> _Inner{};
};

#ifdef __clang__
template <class _Rng> // TRANSITION, LLVM-47414
concept _Can_const_join = forward_range<const _Rng> && is_reference_v<range_reference_t<const _Rng>>
&& input_range<range_reference_t<const _Rng>>;
#endif // ^^^ workaround ^^^

template <class _Ty>
_NODISCARD constexpr _Ty& _As_lvalue(_Ty&& _Val) noexcept {
return static_cast<_Ty&>(_Val);
}

template <class _Vw>
requires is_reference_v<range_reference_t<_Vw>>
class _Join_view_base<_Vw> : public view_interface<join_view<_Vw>> {};
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/regex
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ public:
}

void swap(sub_match& _Other) noexcept(_Is_nothrow_swappable<_BidIt>::value) {
this->_Mybase::swap(_Other);
_Mybase::swap(_Other);
_STD swap(matched, _Other.matched);
}

Expand Down
2 changes: 1 addition & 1 deletion stl/inc/type_traits
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ _CONSTEXPR17 auto invoke(_Callable&& _Obj, _Ty1&& _Arg1, _Types2&&... _Args2) no
} else if constexpr (_Invoker1<_Callable, _Ty1>::_Strategy == _Invoker_strategy::_Pmd_refwrap) {
return _Arg1.get().*_Obj;
} else {
static_assert(_Invoker1<_Callable, _Ty1>::_Strategy == _Invoker_strategy::_Pmd_pointer, "bug in invoke");
_STL_INTERNAL_STATIC_ASSERT(_Invoker1<_Callable, _Ty1>::_Strategy == _Invoker_strategy::_Pmd_pointer);
return (*static_cast<_Ty1&&>(_Arg1)).*_Obj;
}
}
Expand Down
3 changes: 2 additions & 1 deletion stl/inc/xatomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR

#include _STL_INTRIN_HEADER
#include <type_traits>

#include _STL_INTRIN_HEADER

#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
Expand Down
1 change: 1 addition & 0 deletions stl/inc/xbit_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#if _STL_COMPILER_PREPROCESSOR

#include <cstdint>

#include _STL_INTRIN_HEADER

#pragma pack(push, _CRT_PACKING)
Expand Down
4 changes: 2 additions & 2 deletions stl/inc/xcharconv_ryu.h
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ _NODISCARD pair<_CharT*, errc> __to_chars(_CharT* const _First, _CharT* const _L
chars_format _Fmt, const uint32_t __ieeeMantissa, const uint32_t __ieeeExponent) {
// Step 5: Print the decimal representation.
uint32_t _Output = __v.__mantissa;
int32_t _Ryu_exponent = __v.__exponent;
const int32_t _Ryu_exponent = __v.__exponent;
const uint32_t __olength = __decimalLength9(_Output);
int32_t _Scientific_exponent = _Ryu_exponent + static_cast<int32_t>(__olength) - 1;

Expand Down Expand Up @@ -1926,7 +1926,7 @@ _NODISCARD pair<_CharT*, errc> __to_chars(_CharT* const _First, _CharT* const _L
chars_format _Fmt, const double __f) {
// Step 5: Print the decimal representation.
uint64_t _Output = __v.__mantissa;
int32_t _Ryu_exponent = __v.__exponent;
const int32_t _Ryu_exponent = __v.__exponent;
const uint32_t __olength = __decimalLength17(_Output);
int32_t _Scientific_exponent = _Ryu_exponent + static_cast<int32_t>(__olength) - 1;

Expand Down
2 changes: 1 addition & 1 deletion stl/inc/xutility
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ struct _Ref_fn { // pass function object by value as a reference
};

template <class _Fn>
constexpr auto _Pass_fn(_Fn& _Func) noexcept {
_NODISCARD constexpr auto _Pass_fn(_Fn& _Func) noexcept {
constexpr bool _Pass_by_value = conjunction_v<bool_constant<sizeof(_Fn) <= sizeof(void*)>,
is_trivially_copy_constructible<_Fn>, is_trivially_destructible<_Fn>>;
if constexpr (_Pass_by_value) {
Expand Down
2 changes: 2 additions & 0 deletions stl/src/ppltasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ namespace Concurrency {
#if (defined(_M_IX86) || defined(_M_X64)) && !defined(_CRT_APP)
if (IsProcessorFeaturePresent(PF_FASTFAIL_AVAILABLE))
#endif
{
__fastfail(FAST_FAIL_INVALID_ARG);
}

std::terminate();
}
Expand Down
6 changes: 2 additions & 4 deletions stl/src/xmath.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#ifndef _XMATH
#define _XMATH
#pragma once

#include <cerrno>
#include <cmath>
#include <limits>
Expand Down Expand Up @@ -205,5 +205,3 @@ template <typename T>
#ifndef _M_CEE_PURE
#pragma float_control(pop)
#endif

#endif // _XMATH
13 changes: 1 addition & 12 deletions stl/src/xmtx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,13 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#pragma once
#ifndef _XMTX
#define _XMTX

#include <yvals.h>

#include <cstdlib>

#include <Windows.h>

#pragma pack(push, _CRT_PACKING)
#pragma warning(push, 3)
#pragma push_macro("new")
#undef new

_EXTERN_C_UNLESS_PURE

using _Rmtx = CRITICAL_SECTION;
Expand All @@ -33,8 +27,3 @@ _MRTIMP2 void __cdecl _Mtxunlock(_Rmtx*) noexcept;
#endif // _M_CEE_PURE

_END_EXTERN_C_UNLESS_PURE

#pragma pop_macro("new")
#pragma warning(pop)
#pragma pack(pop)
#endif // _XMTX