Skip to content

Commit 8499dc1

Browse files
Various cleanups (#3533)
1 parent f2633d3 commit 8499dc1

File tree

15 files changed

+35
-40
lines changed

15 files changed

+35
-40
lines changed

stl/inc/__msvc_int128.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
#include <yvals_core.h>
1111
#if _STL_COMPILER_PREPROCESSOR
1212
#include <cstdint>
13-
#include _STL_INTRIN_HEADER
1413
#include <limits>
1514
#include <type_traits>
1615

16+
#include _STL_INTRIN_HEADER
17+
1718
#if _HAS_CXX20
1819
#include <bit>
1920
#include <compare>

stl/inc/bit

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
_EMIT_STL_WARNING(STL4038, "The contents of <bit> are available only with C++20 or later.");
1313
#else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv
1414

15-
#include _STL_INTRIN_HEADER
1615
#include <isa_availability.h>
1716
#include <limits>
1817
#include <type_traits>
1918

19+
#include _STL_INTRIN_HEADER
20+
2021
#pragma pack(push, _CRT_PACKING)
2122
#pragma warning(push, _STL_WARNING_LEVEL)
2223
#pragma warning(disable : _STL_DISABLED_WARNINGS)

stl/inc/charconv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313
_EMIT_STL_WARNING(STL4038, "The contents of <charconv> are available only with C++17 or later.");
1414
#else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv
1515
#include <cstring>
16-
#include _STL_INTRIN_HEADER
1716
#include <xbit_ops.h>
1817
#include <xcharconv.h>
1918
#include <xcharconv_ryu.h>
2019
#include <xcharconv_tables.h>
2120
#include <xutility>
2221

22+
#include _STL_INTRIN_HEADER
23+
2324
#pragma pack(push, _CRT_PACKING)
2425
#pragma warning(push, _STL_WARNING_LEVEL)
2526
#pragma warning(disable : _STL_DISABLED_WARNINGS)

stl/inc/limits

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
#include <cfloat>
1212
#include <climits>
1313
#include <cwchar>
14-
#include _STL_INTRIN_HEADER
1514
#include <isa_availability.h>
1615
#include <xstddef>
1716

17+
#include _STL_INTRIN_HEADER
18+
1819
// TRANSITION, GH-2129, move down to _Arm64_popcount
1920
#if (defined(_M_ARM64) || defined(_M_ARM64EC)) && !defined(_M_CEE_PURE) && !defined(__CUDACC__) \
2021
&& !defined(__INTEL_COMPILER) && !defined(__clang__) // TRANSITION, LLVM-51488

stl/inc/memory_resource

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,18 +576,18 @@ namespace pmr {
576576

577577
void release() noexcept /* strengthened */ {
578578
lock_guard<mutex> _Guard{_Mtx};
579-
this->unsynchronized_pool_resource::release();
579+
unsynchronized_pool_resource::release();
580580
}
581581

582582
protected:
583583
void* do_allocate(const size_t _Bytes, const size_t _Align) override {
584584
lock_guard<mutex> _Guard{_Mtx};
585-
return this->unsynchronized_pool_resource::do_allocate(_Bytes, _Align);
585+
return unsynchronized_pool_resource::do_allocate(_Bytes, _Align);
586586
}
587587

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

593593
private:

stl/inc/ranges

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3539,6 +3539,17 @@ namespace ranges {
35393539
_EXPORT_STD inline constexpr _Drop_while_fn drop_while;
35403540
} // namespace views
35413541

3542+
#ifdef __clang__
3543+
template <class _Rng> // TRANSITION, LLVM-47414
3544+
concept _Can_const_join = forward_range<const _Rng> && is_reference_v<range_reference_t<const _Rng>>
3545+
&& input_range<range_reference_t<const _Rng>>;
3546+
#endif // ^^^ workaround ^^^
3547+
3548+
template <class _Ty>
3549+
_NODISCARD constexpr _Ty& _As_lvalue(_Ty&& _Val) noexcept {
3550+
return static_cast<_Ty&>(_Val);
3551+
}
3552+
35423553
_EXPORT_STD template <input_range _Vw>
35433554
requires view<_Vw> && input_range<range_reference_t<_Vw>>
35443555
class join_view;
@@ -3559,17 +3570,6 @@ namespace ranges {
35593570
/* [[no_unique_address]] */ _Non_propagating_cache<_Cache_wrapper, false> _Inner{};
35603571
};
35613572

3562-
#ifdef __clang__
3563-
template <class _Rng> // TRANSITION, LLVM-47414
3564-
concept _Can_const_join = forward_range<const _Rng> && is_reference_v<range_reference_t<const _Rng>>
3565-
&& input_range<range_reference_t<const _Rng>>;
3566-
#endif // ^^^ workaround ^^^
3567-
3568-
template <class _Ty>
3569-
_NODISCARD constexpr _Ty& _As_lvalue(_Ty&& _Val) noexcept {
3570-
return static_cast<_Ty&>(_Val);
3571-
}
3572-
35733573
template <class _Vw>
35743574
requires is_reference_v<range_reference_t<_Vw>>
35753575
class _Join_view_base<_Vw> : public view_interface<join_view<_Vw>> {};

stl/inc/regex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ public:
628628
}
629629

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

stl/inc/type_traits

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1610,7 +1610,7 @@ _CONSTEXPR17 auto invoke(_Callable&& _Obj, _Ty1&& _Arg1, _Types2&&... _Args2) no
16101610
} else if constexpr (_Invoker1<_Callable, _Ty1>::_Strategy == _Invoker_strategy::_Pmd_refwrap) {
16111611
return _Arg1.get().*_Obj;
16121612
} else {
1613-
static_assert(_Invoker1<_Callable, _Ty1>::_Strategy == _Invoker_strategy::_Pmd_pointer, "bug in invoke");
1613+
_STL_INTERNAL_STATIC_ASSERT(_Invoker1<_Callable, _Ty1>::_Strategy == _Invoker_strategy::_Pmd_pointer);
16141614
return (*static_cast<_Ty1&&>(_Arg1)).*_Obj;
16151615
}
16161616
}

stl/inc/xatomic.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
#include <yvals_core.h>
1010
#if _STL_COMPILER_PREPROCESSOR
1111

12-
#include _STL_INTRIN_HEADER
1312
#include <type_traits>
1413

14+
#include _STL_INTRIN_HEADER
15+
1516
#pragma pack(push, _CRT_PACKING)
1617
#pragma warning(push, _STL_WARNING_LEVEL)
1718
#pragma warning(disable : _STL_DISABLED_WARNINGS)

stl/inc/xbit_ops.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#if _STL_COMPILER_PREPROCESSOR
1111

1212
#include <cstdint>
13+
1314
#include _STL_INTRIN_HEADER
1415

1516
#pragma pack(push, _CRT_PACKING)

0 commit comments

Comments
 (0)