From 4c110bf9b47f9b93c248d33efab0ffea1fbe1259 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 7 Dec 2023 08:41:33 -0800 Subject: [PATCH] Various cleanups (#4230) --- benchmarks/src/std_copy.cpp | 1 - stl/inc/algorithm | 1 - stl/inc/condition_variable | 9 +++++---- stl/inc/deque | 3 --- stl/inc/mdspan | 6 ++---- stl/inc/memory_resource | 1 - stl/inc/optional | 2 +- stl/inc/thread | 9 +++++---- stl/inc/vector | 2 -- stl/inc/xbit_ops.h | 1 - stl/inc/xlocinfo | 1 - stl/inc/xutility | 1 - stl/inc/yvals.h | 5 ++--- stl/inc/yvals_core.h | 2 +- stl/src/cerr.cpp | 1 - stl/src/cin.cpp | 1 - stl/src/clog.cpp | 1 - stl/src/cond.cpp | 4 +--- stl/src/cout.cpp | 1 - stl/src/cthread.cpp | 2 -- stl/src/filesystem.cpp | 1 - stl/src/init_locks.hpp | 1 - stl/src/mutex.cpp | 2 -- stl/src/sharedmutex.cpp | 1 - stl/src/thread0.cpp | 2 -- stl/src/xcosh.cpp | 2 -- stl/src/xexp.cpp | 2 -- stl/src/xfcosh.cpp | 2 -- stl/src/xferaise.cpp | 2 -- stl/src/xfexp.cpp | 2 -- stl/src/xfsinh.cpp | 2 -- stl/src/xlcosh.cpp | 2 -- stl/src/xlexp.cpp | 2 -- stl/src/xlpoly.cpp | 2 -- stl/src/xlsinh.cpp | 2 -- stl/src/xnotify.cpp | 2 -- stl/src/xpoly.cpp | 2 -- stl/src/xsinh.cpp | 2 -- stl/src/xstod.cpp | 2 -- stl/src/xstof.cpp | 2 -- stl/src/xstoflt.cpp | 2 -- stl/src/xstol.cpp | 2 -- stl/src/xstold.cpp | 2 -- stl/src/xstoll.cpp | 5 ++--- stl/src/xstopfx.cpp | 2 -- stl/src/xstoul.cpp | 3 +-- stl/src/xstoull.cpp | 3 +-- stl/src/xstoxflt.cpp | 2 -- stl/src/xthrow.cpp | 2 -- stl/src/xwcsxfrm.cpp | 1 - stl/src/xwstod.cpp | 2 -- stl/src/xwstof.cpp | 2 -- stl/src/xwstoflt.cpp | 2 -- stl/src/xwstold.cpp | 2 -- stl/src/xwstopfx.cpp | 2 -- stl/src/xwstoxfl.cpp | 2 -- .../test.cpp | 1 - 57 files changed, 21 insertions(+), 107 deletions(-) diff --git a/benchmarks/src/std_copy.cpp b/benchmarks/src/std_copy.cpp index 089845799..a96e32e1e 100644 --- a/benchmarks/src/std_copy.cpp +++ b/benchmarks/src/std_copy.cpp @@ -12,7 +12,6 @@ #include namespace { - template void handwritten_loop(benchmark::State& state) { const size_t r0 = static_cast(state.range(0)); diff --git a/stl/inc/algorithm b/stl/inc/algorithm index cfb192735..50fa3223b 100644 --- a/stl/inc/algorithm +++ b/stl/inc/algorithm @@ -10446,7 +10446,6 @@ _NODISCARD constexpr const _Ty& clamp(const _Ty& _Val, const _Ty& _Min_val, cons const _Ty& _Tmp = _DEBUG_LT_PRED(_Pred, _Val, _Min_val) ? _Min_val : _Val; return _DEBUG_LT_PRED(_Pred, _Max_val, _Val) ? _Max_val : _Tmp; } else { - if (_DEBUG_LT_PRED(_Pred, _Max_val, _Val)) { return _Max_val; } diff --git a/stl/inc/condition_variable b/stl/inc/condition_variable index 6f2908d28..8e1145db8 100644 --- a/stl/inc/condition_variable +++ b/stl/inc/condition_variable @@ -7,6 +7,11 @@ #define _CONDITION_VARIABLE_ #include #if _STL_COMPILER_PREPROCESSOR + +#ifdef _M_CEE_PURE +#error is not supported when compiling with /clr:pure. +#endif // defined(_M_CEE_PURE) + #include <__msvc_chrono.hpp> #include #include @@ -22,10 +27,6 @@ _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("new") #undef new -#ifdef _M_CEE_PURE -#error is not supported when compiling with /clr:pure. -#endif // defined(_M_CEE_PURE) - _STD_BEGIN template struct _NODISCARD _Unlock_guard { diff --git a/stl/inc/deque b/stl/inc/deque index aef5fac28..933117796 100644 --- a/stl/inc/deque +++ b/stl/inc/deque @@ -1424,7 +1424,6 @@ public: ++_Myoff(); } } - #else // ^^^ _ITERATOR_DEBUG_LEVEL == 2 / _ITERATOR_DEBUG_LEVEL < 2 vvv _Alty_traits::destroy(_Getal(), _Get_data()._Address_subscript(_Myoff())); if (--_Mysize() == 0) { @@ -1447,7 +1446,6 @@ public: _Myoff() = 0; } } - #else // ^^^ _ITERATOR_DEBUG_LEVEL == 2 / _ITERATOR_DEBUG_LEVEL < 2 vvv size_type _Newoff = _Myoff() + _Mysize() - 1; _Alty_traits::destroy(_Getal(), _Get_data()._Address_subscript(_Newoff)); @@ -1473,7 +1471,6 @@ public: auto _Off = static_cast(_First - begin()); auto _Count = static_cast(_Last - _First); bool _Moved = _Off > 0 && _Off + _Count < _Mysize(); - #else // ^^^ _ITERATOR_DEBUG_LEVEL == 2 / _ITERATOR_DEBUG_LEVEL < 2 vvv auto _Off = static_cast(_First - begin()); auto _Count = static_cast(_Last - _First); diff --git a/stl/inc/mdspan b/stl/inc/mdspan index ecdd6e588..93ff8e06d 100644 --- a/stl/inc/mdspan +++ b/stl/inc/mdspan @@ -1319,8 +1319,7 @@ public: requires is_convertible_v && is_nothrow_constructible_v _NODISCARD constexpr reference operator[](span<_OtherIndexType, rank()> _Indices) const - noexcept(noexcept(_Multidimensional_subscript(_Indices, make_index_sequence{}))) /* strengthened */ - { + noexcept(noexcept(_Multidimensional_subscript(_Indices, make_index_sequence{}))) /* strengthened */ { return _Multidimensional_subscript(_Indices, make_index_sequence{}); } @@ -1328,8 +1327,7 @@ public: requires is_convertible_v && is_nothrow_constructible_v _NODISCARD constexpr reference operator[](const array<_OtherIndexType, rank()>& _Indices) const noexcept( - noexcept(_Multidimensional_subscript(span{_Indices}, make_index_sequence{}))) /* strengthened */ - { + noexcept(_Multidimensional_subscript(span{_Indices}, make_index_sequence{}))) /* strengthened */ { return _Multidimensional_subscript(span{_Indices}, make_index_sequence{}); } diff --git a/stl/inc/memory_resource b/stl/inc/memory_resource index 9468c2508..05e77f606 100644 --- a/stl/inc/memory_resource +++ b/stl/inc/memory_resource @@ -30,7 +30,6 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN namespace pmr { - extern "C" _CRT_SATELLITE_1 memory_resource* __cdecl _Aligned_set_default_resource(memory_resource*) noexcept; extern "C" _CRT_SATELLITE_1 memory_resource* __cdecl _Unaligned_set_default_resource(memory_resource*) noexcept; diff --git a/stl/inc/optional b/stl/inc/optional index 1402a7693..410c3e3c0 100644 --- a/stl/inc/optional +++ b/stl/inc/optional @@ -693,7 +693,7 @@ _EXPORT_STD template _NODISCARD constexpr bool operator<=(const optional<_Ty1>& _Left, const optional<_Ty2>& _Right) noexcept( noexcept(_Fake_copy_init(*_Left <= *_Right))) /* strengthened */ #ifdef __cpp_lib_concepts - requires requires(const _Ty1& _Elem1, const _Ty2& _Elem2) { + requires requires { { *_Left <= *_Right } -> _Implicitly_convertible_to; } #endif // defined(__cpp_lib_concepts) diff --git a/stl/inc/thread b/stl/inc/thread index 67002a8d7..2d47227b1 100644 --- a/stl/inc/thread +++ b/stl/inc/thread @@ -7,6 +7,11 @@ #define _THREAD_ #include #if _STL_COMPILER_PREPROCESSOR + +#ifdef _M_CEE_PURE +#error is not supported when compiling with /clr:pure. +#endif // defined(_M_CEE_PURE) + #include <__msvc_chrono.hpp> #include #include @@ -22,10 +27,6 @@ #include #endif // _HAS_CXX23 && defined(__cpp_lib_concepts) -#ifdef _M_CEE_PURE -#error is not supported when compiling with /clr:pure. -#endif // defined(_M_CEE_PURE) - #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) #pragma warning(disable : _STL_DISABLED_WARNINGS) diff --git a/stl/inc/vector b/stl/inc/vector index 680499edf..7d0421482 100644 --- a/stl/inc/vector +++ b/stl/inc/vector @@ -3408,7 +3408,6 @@ public: _STL_VERIFY(end() > _Where, "vector erase iterator outside range"); _STD copy(_Next_iter(_Where), end(), _Where); _Orphan_range(static_cast(_Off), this->_Mysize); - #else // ^^^ _ITERATOR_DEBUG_LEVEL == 2 / _ITERATOR_DEBUG_LEVEL < 2 vvv _STD copy(_Next_iter(_Where), end(), _Where); #endif // ^^^ _ITERATOR_DEBUG_LEVEL < 2 ^^^ @@ -3430,7 +3429,6 @@ public: const auto _Newsize = static_cast(_Next - begin()); _Orphan_range(_Newsize, this->_Mysize); _Trim(_Newsize); - #else // ^^^ _ITERATOR_DEBUG_LEVEL == 2 / _ITERATOR_DEBUG_LEVEL < 2 vvv iterator _Next = _STD copy(_Last, end(), _First); _Trim(static_cast(_Next - begin())); diff --git a/stl/inc/xbit_ops.h b/stl/inc/xbit_ops.h index f80c8214f..3822e0168 100644 --- a/stl/inc/xbit_ops.h +++ b/stl/inc/xbit_ops.h @@ -35,7 +35,6 @@ _NODISCARD inline unsigned long _Floor_of_log_2(size_t _Value) noexcept { // ret while ((size_t{1} << _Result) > _Value) { --_Result; } - #else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv #ifdef _WIN64 _BitScanReverse64(&_Result, _Value); // lgtm [cpp/conditionallyuninitializedvariable] diff --git a/stl/inc/xlocinfo b/stl/inc/xlocinfo index 9a7ef40a1..80487ea2f 100644 --- a/stl/inc/xlocinfo +++ b/stl/inc/xlocinfo @@ -52,7 +52,6 @@ _CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL _Getdateorder() noexcept; [System::Runtime::InteropServices::DllImport(_CRT_MSVCP_CURRENT, EntryPoint = "_Mbrtowc", CallingConvention = System::Runtime::InteropServices::CallingConvention::Cdecl)] extern "C" int _Mbrtowc(_Out_opt_ wchar_t*, const char*, size_t, mbstate_t*, const _Cvtvec*) noexcept; - #else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv _MRTIMP2 _Success_(return >= 0) int __cdecl _Mbrtowc(_When_(_Max_multibyte != 0, _Out_) wchar_t*, const char*, size_t _Max_multibyte, mbstate_t*, const _Cvtvec*) noexcept; diff --git a/stl/inc/xutility b/stl/inc/xutility index 1df82ec4a..beb375de1 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -5369,7 +5369,6 @@ namespace ranges { requires indirectly_comparable<_It1, _It2, _Pr, _Pj1, _Pj2> _NODISCARD constexpr mismatch_result<_It1, _It2> _Mismatch_4( _It1 _First1, _Se1 _Last1, _It2 _First2, _Se2 _Last2, _Pr _Pred, _Pj1 _Proj1, _Pj2 _Proj2) { - for (; _First1 != _Last1 && _First2 != _Last2; ++_First1, (void) ++_First2) { if (!_STD invoke(_Pred, _STD invoke(_Proj1, *_First1), _STD invoke(_Proj2, *_First2))) { break; diff --git a/stl/inc/yvals.h b/stl/inc/yvals.h index e032fa5c8..842efae27 100644 --- a/stl/inc/yvals.h +++ b/stl/inc/yvals.h @@ -350,7 +350,6 @@ public: __CLR_OR_THIS_CALL ~_Lockit() noexcept { // clear the lock _Lockit_dtor(this); } - #else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv __thiscall _Lockit() noexcept; explicit __thiscall _Lockit(int) noexcept; // set the lock @@ -452,7 +451,7 @@ private: #define _CATCH_END } #define _RERAISE throw -#define _THROW(...) throw __VA_ARGS__ +#define _THROW(...) throw(__VA_ARGS__) #else // ^^^ _HAS_EXCEPTIONS / !_HAS_EXCEPTIONS vvv #define _TRY_BEGIN \ @@ -475,7 +474,7 @@ private: #endif #define _RERAISE -#define _THROW(...) __VA_ARGS__._Raise() +#define _THROW(...) (__VA_ARGS__)._Raise() #endif // ^^^ !_HAS_EXCEPTIONS ^^^ _STD_END diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 31a357bfc..ffd5e0a96 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -1954,7 +1954,7 @@ compiler option, or define _ALLOW_RTCc_IN_STL to suppress this error. // TRANSITION: _USE_EXTERN_CXX_EVERYWHERE_FOR_STL controls whether we also wrap the STL's // header-only code in this linkage-specification, as a temporary workaround to allow -// the named module to coexist with classic includes in the same translation unit. +// importing the named module in a translation unit with classic includes. #ifndef _USE_EXTERN_CXX_EVERYWHERE_FOR_STL #define _USE_EXTERN_CXX_EVERYWHERE_FOR_STL _HAS_CXX20 diff --git a/stl/src/cerr.cpp b/stl/src/cerr.cpp index 3a5f23ce4..27439ee7b 100644 --- a/stl/src/cerr.cpp +++ b/stl/src/cerr.cpp @@ -18,7 +18,6 @@ __PURE_APPDOMAIN_GLOBAL static filebuf ferr(stderr); #if defined(_M_CEE_PURE) __PURE_APPDOMAIN_GLOBAL extern ostream cerr(&ferr); - #else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv __PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream cerr(&ferr); #endif // ^^^ !defined(_M_CEE_PURE) ^^^ diff --git a/stl/src/cin.cpp b/stl/src/cin.cpp index 6c7b46798..63c03519b 100644 --- a/stl/src/cin.cpp +++ b/stl/src/cin.cpp @@ -18,7 +18,6 @@ __PURE_APPDOMAIN_GLOBAL static filebuf fin(stdin); #if defined(_M_CEE_PURE) __PURE_APPDOMAIN_GLOBAL extern istream cin(&fin); - #else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv __PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT istream cin(&fin); #endif // ^^^ !defined(_M_CEE_PURE) ^^^ diff --git a/stl/src/clog.cpp b/stl/src/clog.cpp index e29b72ec8..5a1d22a0c 100644 --- a/stl/src/clog.cpp +++ b/stl/src/clog.cpp @@ -20,7 +20,6 @@ __PURE_APPDOMAIN_GLOBAL static filebuf flog(stderr); #if defined(_M_CEE_PURE) __PURE_APPDOMAIN_GLOBAL extern ostream clog(&flog); - #else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv __PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream clog(&flog); #endif // ^^^ !defined(_M_CEE_PURE) ^^^ diff --git a/stl/src/cond.cpp b/stl/src/cond.cpp index 107e5865d..114475ee3 100644 --- a/stl/src/cond.cpp +++ b/stl/src/cond.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// condition variable functions - #include #include #include @@ -13,7 +11,7 @@ extern "C" { -struct _Cnd_internal_imp_t { // condition variable implementation for ConcRT +struct _Cnd_internal_imp_t { typename std::_Aligned_storage<_Cnd_internal_imp_size, _Cnd_internal_imp_alignment>::type cv; [[nodiscard]] Concurrency::details::stl_condition_variable_win7* _get_cv() noexcept { diff --git a/stl/src/cout.cpp b/stl/src/cout.cpp index 02ab1f7eb..3a4058cd6 100644 --- a/stl/src/cout.cpp +++ b/stl/src/cout.cpp @@ -18,7 +18,6 @@ __PURE_APPDOMAIN_GLOBAL static filebuf fout(stdout); #if defined(_M_CEE_PURE) __PURE_APPDOMAIN_GLOBAL extern ostream cout(&fout); - #else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv __PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream cout(&fout); #endif // ^^^ !defined(_M_CEE_PURE) ^^^ diff --git a/stl/src/cthread.cpp b/stl/src/cthread.cpp index ba3b2d81c..141fbe9d4 100644 --- a/stl/src/cthread.cpp +++ b/stl/src/cthread.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// thread functions - #include #include #include diff --git a/stl/src/filesystem.cpp b/stl/src/filesystem.cpp index 43b0c1b28..5fdde72e6 100644 --- a/stl/src/filesystem.cpp +++ b/stl/src/filesystem.cpp @@ -599,7 +599,6 @@ _Success_(return == __std_win_error::_Success) __std_win_error } if (_Last_error == __std_win_error::_Access_denied && _Able_to_change_attributes) { - FILE_BASIC_INFO _Basic_info; if (!GetFileInformationByHandleEx(_Handle._Get(), FileBasicInfo, &_Basic_info, sizeof(_Basic_info))) { return {false, __std_win_error{GetLastError()}}; diff --git a/stl/src/init_locks.hpp b/stl/src/init_locks.hpp index c121564d3..737ad5a89 100644 --- a/stl/src/init_locks.hpp +++ b/stl/src/init_locks.hpp @@ -17,7 +17,6 @@ public: __CLR_OR_THIS_CALL ~_Init_locks() noexcept { _Init_locks_dtor(this); } - #else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv __thiscall _Init_locks() noexcept; __thiscall ~_Init_locks() noexcept; diff --git a/stl/src/mutex.cpp b/stl/src/mutex.cpp index 5d20b5609..884b4f32f 100644 --- a/stl/src/mutex.cpp +++ b/stl/src/mutex.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// mutex functions - #include #include #include diff --git a/stl/src/sharedmutex.cpp b/stl/src/sharedmutex.cpp index 678df6eea..64f50fe74 100644 --- a/stl/src/sharedmutex.cpp +++ b/stl/src/sharedmutex.cpp @@ -6,7 +6,6 @@ // these declarations must be in sync with those in xthreads.h extern "C" { - using _Smtx_t = void*; static_assert(sizeof(_Smtx_t) == sizeof(SRWLOCK), "_Smtx_t must be the same size as SRWLOCK."); diff --git a/stl/src/thread0.cpp b/stl/src/thread0.cpp index 804ee3e30..23b098d39 100644 --- a/stl/src/thread0.cpp +++ b/stl/src/thread0.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// thread support functions - #include #include #include diff --git a/stl/src/xcosh.cpp b/stl/src/xcosh.cpp index f890f5fbc..7708aa73a 100644 --- a/stl/src/xcosh.cpp +++ b/stl/src/xcosh.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _Cosh function - #include "xmath.hpp" _EXTERN_C_UNLESS_PURE diff --git a/stl/src/xexp.cpp b/stl/src/xexp.cpp index 4c359b0ca..ff6440106 100644 --- a/stl/src/xexp.cpp +++ b/stl/src/xexp.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _Exp function - #include "xmath.hpp" _EXTERN_C_UNLESS_PURE diff --git a/stl/src/xfcosh.cpp b/stl/src/xfcosh.cpp index f1c3ab3c3..5fb3ce518 100644 --- a/stl/src/xfcosh.cpp +++ b/stl/src/xfcosh.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _FCosh function - #include "xmath.hpp" _EXTERN_C_UNLESS_PURE diff --git a/stl/src/xferaise.cpp b/stl/src/xferaise.cpp index 7f6e4ed07..b973fc238 100644 --- a/stl/src/xferaise.cpp +++ b/stl/src/xferaise.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _Feraise function - #include "xmath.hpp" _EXTERN_C_UNLESS_PURE diff --git a/stl/src/xfexp.cpp b/stl/src/xfexp.cpp index ffc990b53..2b3240ca7 100644 --- a/stl/src/xfexp.cpp +++ b/stl/src/xfexp.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _FExp function - #include "xmath.hpp" _EXTERN_C_UNLESS_PURE diff --git a/stl/src/xfsinh.cpp b/stl/src/xfsinh.cpp index 5f9e82aba..4b86173e3 100644 --- a/stl/src/xfsinh.cpp +++ b/stl/src/xfsinh.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _FSinh function - #include "xmath.hpp" _EXTERN_C_UNLESS_PURE diff --git a/stl/src/xlcosh.cpp b/stl/src/xlcosh.cpp index d713795dd..b5bfcfa2b 100644 --- a/stl/src/xlcosh.cpp +++ b/stl/src/xlcosh.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _LCosh function - #include "xmath.hpp" _EXTERN_C_UNLESS_PURE diff --git a/stl/src/xlexp.cpp b/stl/src/xlexp.cpp index 1d4788be6..b47a4dbbb 100644 --- a/stl/src/xlexp.cpp +++ b/stl/src/xlexp.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _LExp function - #include "xmath.hpp" _EXTERN_C_UNLESS_PURE diff --git a/stl/src/xlpoly.cpp b/stl/src/xlpoly.cpp index ce1e35503..ef7001ecf 100644 --- a/stl/src/xlpoly.cpp +++ b/stl/src/xlpoly.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _LPoly function - #include "xmath.hpp" _EXTERN_C_UNLESS_PURE diff --git a/stl/src/xlsinh.cpp b/stl/src/xlsinh.cpp index 3a57f8f0e..6b1bc9ff8 100644 --- a/stl/src/xlsinh.cpp +++ b/stl/src/xlsinh.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _LSinh function - #include #include "xmath.hpp" diff --git a/stl/src/xnotify.cpp b/stl/src/xnotify.cpp index 57fc2c5ce..1b6e8fcbd 100644 --- a/stl/src/xnotify.cpp +++ b/stl/src/xnotify.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// thread exit notification functions - #include #include diff --git a/stl/src/xpoly.cpp b/stl/src/xpoly.cpp index c6005089f..32360f5f0 100644 --- a/stl/src/xpoly.cpp +++ b/stl/src/xpoly.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _Poly function - #include "xmath.hpp" _EXTERN_C_UNLESS_PURE diff --git a/stl/src/xsinh.cpp b/stl/src/xsinh.cpp index e5d22f698..e9075ec6b 100644 --- a/stl/src/xsinh.cpp +++ b/stl/src/xsinh.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _Sinh function - #include #include "xmath.hpp" diff --git a/stl/src/xstod.cpp b/stl/src/xstod.cpp index 7b1ef5954..519115f62 100644 --- a/stl/src/xstod.cpp +++ b/stl/src/xstod.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _Stod function - #include // include first, for native shared #include diff --git a/stl/src/xstof.cpp b/stl/src/xstof.cpp index be415f597..410e5c8e3 100644 --- a/stl/src/xstof.cpp +++ b/stl/src/xstof.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _Stof function - #include // include first, for native shared #include diff --git a/stl/src/xstoflt.cpp b/stl/src/xstoflt.cpp index 4322cc1a7..124935934 100644 --- a/stl/src/xstoflt.cpp +++ b/stl/src/xstoflt.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _Stoflt function - #include #include #include diff --git a/stl/src/xstol.cpp b/stl/src/xstol.cpp index c6ca2a4e7..6a4507dbc 100644 --- a/stl/src/xstol.cpp +++ b/stl/src/xstol.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _Stolx function - #include #include diff --git a/stl/src/xstold.cpp b/stl/src/xstold.cpp index 38834756e..54f4df240 100644 --- a/stl/src/xstold.cpp +++ b/stl/src/xstold.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _Stold function - #include // include first, for native shared #include diff --git a/stl/src/xstoll.cpp b/stl/src/xstoll.cpp index 5843f626c..4eaed74c2 100644 --- a/stl/src/xstoll.cpp +++ b/stl/src/xstoll.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _Stoll function - #include #include @@ -48,7 +46,8 @@ _CRTIMP2_PURE long long __CLRCALL_PURE_OR_CDECL _Stollx(const char* s, char** en return static_cast(sign == '-' ? 0 - x : x); } -_CRTIMP2_PURE long long(__CLRCALL_PURE_OR_CDECL _Stoll)(const char* s, char** endptr, int base) noexcept { +// TRANSITION, ABI: preserved for binary compatibility +_CRTIMP2_PURE long long __CLRCALL_PURE_OR_CDECL _Stoll(const char* s, char** endptr, int base) noexcept { // convert string, discard error code return _Stollx(s, endptr, base, nullptr); } diff --git a/stl/src/xstopfx.cpp b/stl/src/xstopfx.cpp index 6218ac39b..56947eaf3 100644 --- a/stl/src/xstopfx.cpp +++ b/stl/src/xstopfx.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _Stopfx function - #include #include "xmath.hpp" diff --git a/stl/src/xstoul.cpp b/stl/src/xstoul.cpp index 272a6f4db..507896590 100644 --- a/stl/src/xstoul.cpp +++ b/stl/src/xstoul.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _Stoul function - #include #include @@ -109,6 +107,7 @@ _CRTIMP2_PURE unsigned long __CLRCALL_PURE_OR_CDECL _Stoulx( return x; } +// TRANSITION, ABI: preserved for binary compatibility _CRTIMP2_PURE unsigned long __CLRCALL_PURE_OR_CDECL _Stoul(const char* s, char** endptr, int base) noexcept { // convert string, discard error code return _Stoulx(s, endptr, base, nullptr); diff --git a/stl/src/xstoull.cpp b/stl/src/xstoull.cpp index 6a7a11af5..5d058e9d0 100644 --- a/stl/src/xstoull.cpp +++ b/stl/src/xstoull.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _Stoull function - #include #include @@ -107,6 +105,7 @@ _CRTIMP2_PURE unsigned long long __CLRCALL_PURE_OR_CDECL _Stoullx( return x; } +// TRANSITION, ABI: preserved for binary compatibility _CRTIMP2_PURE unsigned long long __CLRCALL_PURE_OR_CDECL _Stoull(const char* s, char** endptr, int base) noexcept { // convert string, discard error code return _Stoullx(s, endptr, base, nullptr); diff --git a/stl/src/xstoxflt.cpp b/stl/src/xstoxflt.cpp index a898f16b5..64b11ce18 100644 --- a/stl/src/xstoxflt.cpp +++ b/stl/src/xstoxflt.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _Stoxflt function - #include #include #include diff --git a/stl/src/xthrow.cpp b/stl/src/xthrow.cpp index a9afc6054..2ec0a3eeb 100644 --- a/stl/src/xthrow.cpp +++ b/stl/src/xthrow.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// exception handling support functions - #include #include #include diff --git a/stl/src/xwcsxfrm.cpp b/stl/src/xwcsxfrm.cpp index 175677cd9..417545e1f 100644 --- a/stl/src/xwcsxfrm.cpp +++ b/stl/src/xwcsxfrm.cpp @@ -64,7 +64,6 @@ _CRTIMP2_PURE size_t __CLRCALL_PURE_OR_CDECL _Wcsxfrm(_Out_writes_(end1 - string } size = n2; } else { - // When using LCMAP_SORTKEY, LCMapStringW handles BYTES not wide // chars. We use a byte buffer to hold bytes and then convert the // byte string to a wide char string and return this so it can be diff --git a/stl/src/xwstod.cpp b/stl/src/xwstod.cpp index 01b98439a..cac719244 100644 --- a/stl/src/xwstod.cpp +++ b/stl/src/xwstod.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _WStod function - #include #include diff --git a/stl/src/xwstof.cpp b/stl/src/xwstof.cpp index cfed6e8a3..4861e2035 100644 --- a/stl/src/xwstof.cpp +++ b/stl/src/xwstof.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _WStof function - #include #include "xmath.hpp" diff --git a/stl/src/xwstoflt.cpp b/stl/src/xwstoflt.cpp index ea12f36b9..c5c70cb22 100644 --- a/stl/src/xwstoflt.cpp +++ b/stl/src/xwstoflt.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _WStoflt function - #include #include #include diff --git a/stl/src/xwstold.cpp b/stl/src/xwstold.cpp index be483a7cb..142bea605 100644 --- a/stl/src/xwstold.cpp +++ b/stl/src/xwstold.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _WStold function - #include #include "xmath.hpp" diff --git a/stl/src/xwstopfx.cpp b/stl/src/xwstopfx.cpp index c2f52b9d5..29f15fcc7 100644 --- a/stl/src/xwstopfx.cpp +++ b/stl/src/xwstopfx.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _WStopfx function - #include #include "xmath.hpp" diff --git a/stl/src/xwstoxfl.cpp b/stl/src/xwstoxfl.cpp index 9ca5c4b80..116e579cc 100644 --- a/stl/src/xwstoxfl.cpp +++ b/stl/src/xwstoxfl.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// _WStoxflt function - #include #include #include diff --git a/tests/std/tests/P2387R3_pipe_support_for_user_defined_range_adaptors/test.cpp b/tests/std/tests/P2387R3_pipe_support_for_user_defined_range_adaptors/test.cpp index f1e4bddfe..ea545e4a9 100644 --- a/tests/std/tests/P2387R3_pipe_support_for_user_defined_range_adaptors/test.cpp +++ b/tests/std/tests/P2387R3_pipe_support_for_user_defined_range_adaptors/test.cpp @@ -267,7 +267,6 @@ void test_perfect_forwarding_properties() { // COMPILE-ONLY static_assert(same_as); } { - auto combined_pipeline = RangeIdentity{} | PinnedReturningRaco{}; static_assert(same_as);