diff options
author | Andrey Khalyavin <halyavin@gmail.com> | 2022-04-21 13:17:27 +0300 |
---|---|---|
committer | Andrey Khalyavin <halyavin@gmail.com> | 2022-04-21 13:17:27 +0300 |
commit | ddddb65b4f1f643c2d11077c6af35df1d6ab1656 (patch) | |
tree | c66d94470f9e2f5840a36474a656755c0af4db20 /contrib/libs/cxxsupp | |
parent | f818c45c008cf20b6ac46f7c5f9a0cd5095ccca3 (diff) | |
download | ydb-ddddb65b4f1f643c2d11077c6af35df1d6ab1656.tar.gz |
Update libc++ to 429a717e (20 Jan 2022).
Notable changes:
* use _LIBCPP_DEBUG_ASSERT in unordered_map and vector headers
* use reserved identifiers for template parameters
* fix category of fs::path::iterator
* introduce __debug_db_insert_i() for debug checks to support compile-time evaluation
* add specializations of basic_common_reference and common_type for tuple
* fix std::lognormal_distribution::param_type
* add _LIBCPP_HIDE_FROM_ABI to in_in_result conversion operators
* replace _LIBCPP_INLINE_VISIBILITY with _LIBCPP_HIDE_FROM_ABI in move_iterator.h
* fix __simple_view concept in std::ranges
* add some ASCII/EBCDIC support for z/OS
ref:b0e68cbe142a3f06a8804f247119b5eb0a455a39
Diffstat (limited to 'contrib/libs/cxxsupp')
37 files changed, 699 insertions, 361 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/import b/contrib/libs/cxxsupp/libcxx/import index e3dd5fcfc3..620ce17090 100755 --- a/contrib/libs/cxxsupp/libcxx/import +++ b/contrib/libs/cxxsupp/libcxx/import @@ -1,6 +1,6 @@ #!/bin/sh -e -rev=5726e559 +rev=429a717e output_dir="libcxx-r$rev" if [ -z $1 ] ; then git clone https://github.com/llvm/llvm-project.git --no-checkout "$output_dir/tmp" diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_in_result.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_in_result.h index a1416f4cac..22dc7453b5 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_in_result.h +++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/in_in_result.h @@ -26,13 +26,15 @@ struct in_in_result { template <class _II1, class _II2> requires convertible_to<const _I1&, _II1> && convertible_to<const _I2&, _II2> - constexpr operator in_in_result<_II1, _II2>() const & { + _LIBCPP_HIDE_FROM_ABI constexpr + operator in_in_result<_II1, _II2>() const & { return {in1, in2}; } template <class _II1, class _II2> requires convertible_to<_I1, _II1> && convertible_to<_I2, _II2> - constexpr operator in_in_result<_II1, _II2>() && { return {_VSTD::move(in1), _VSTD::move(in2)}; } + _LIBCPP_HIDE_FROM_ABI constexpr + operator in_in_result<_II1, _II2>() && { return {_VSTD::move(in1), _VSTD::move(in2)}; } }; } // namespace ranges diff --git a/contrib/libs/cxxsupp/libcxx/include/__chrono/convert_to_timespec.h b/contrib/libs/cxxsupp/libcxx/include/__chrono/convert_to_timespec.h new file mode 100644 index 0000000000..0106e6dec3 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__chrono/convert_to_timespec.h @@ -0,0 +1,55 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___CHRONO_CONVERT_TO_TIMESPEC_H +#define _LIBCPP___CHRONO_CONVERT_TO_TIMESPEC_H + +#include <__chrono/duration.h> +#include <__config> +#include <limits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +// Convert a nanoseconds duration to the given TimeSpec type, which must have +// the same properties as std::timespec. +template <class _TimeSpec> +_LIBCPP_HIDE_FROM_ABI inline +_TimeSpec __convert_to_timespec(const chrono::nanoseconds& __ns) +{ + using namespace chrono; + seconds __s = duration_cast<seconds>(__ns); + _TimeSpec __ts; + typedef decltype(__ts.tv_sec) __ts_sec; + const __ts_sec __ts_sec_max = numeric_limits<__ts_sec>::max(); + + if (__s.count() < __ts_sec_max) + { + __ts.tv_sec = static_cast<__ts_sec>(__s.count()); + __ts.tv_nsec = static_cast<decltype(__ts.tv_nsec)>((__ns - __s).count()); + } + else + { + __ts.tv_sec = __ts_sec_max; + __ts.tv_nsec = 999999999; // (10^9 - 1) + } + + return __ts; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___CHRONO_CONVERT_TO_TIMESPEC_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__config b/contrib/libs/cxxsupp/libcxx/include/__config index 0dab7c7235..7dce92dad0 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__config +++ b/contrib/libs/cxxsupp/libcxx/include/__config @@ -269,6 +269,10 @@ # endif // defined(__GLIBC_PREREQ) #endif // defined(__linux__) +#if defined(__MVS__) +# include <features.h> // for __NATIVE_ASCII_F +#endif + #ifdef __LITTLE_ENDIAN__ # if __LITTLE_ENDIAN__ # define _LIBCPP_LITTLE_ENDIAN @@ -1268,9 +1272,9 @@ extern "C" _LIBCPP_FUNC_VIS void __sanitizer_annotate_contiguous_container( # define _LIBCPP_C_HAS_NO_GETS #endif -#if defined(__BIONIC__) || defined(__NuttX__) || \ - defined(__Fuchsia__) || defined(__wasi__) || defined(_LIBCPP_HAS_MUSL_LIBC) || \ - defined(__MVS__) || defined(__OpenBSD__) +#if defined(__BIONIC__) || defined(__NuttX__) || \ + defined(__Fuchsia__) || defined(__wasi__) || \ + defined(_LIBCPP_HAS_MUSL_LIBC) || defined(__OpenBSD__) #define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE #endif diff --git a/contrib/libs/cxxsupp/libcxx/include/__debug b/contrib/libs/cxxsupp/libcxx/include/__debug index 29c51b2f2f..a1e21a7032 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__debug +++ b/contrib/libs/cxxsupp/libcxx/include/__debug @@ -279,6 +279,16 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 inline void __debug_db_inser #endif } +template <class _Tp> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 inline void __debug_db_insert_i(_Tp* __i) { +#if _LIBCPP_DEBUG_LEVEL == 2 + if (!__libcpp_is_constant_evaluated()) + __get_db()->__insert_i(__i); +#else + (void)(__i); +#endif +} + _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP_DEBUG_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__filesystem/path_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__filesystem/path_iterator.h index 55e97b1454..08039e4c8a 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__filesystem/path_iterator.h +++ b/contrib/libs/cxxsupp/libcxx/include/__filesystem/path_iterator.h @@ -38,15 +38,13 @@ public: }; public: - typedef bidirectional_iterator_tag iterator_category; + typedef input_iterator_tag iterator_category; + typedef bidirectional_iterator_tag iterator_concept; typedef path value_type; typedef ptrdiff_t difference_type; typedef const path* pointer; - typedef const path& reference; - - typedef void - __stashing_iterator_tag; // See reverse_iterator and __is_stashing_iterator + typedef path reference; public: _LIBCPP_INLINE_VISIBILITY diff --git a/contrib/libs/cxxsupp/libcxx/include/__hash_table b/contrib/libs/cxxsupp/libcxx/include/__hash_table index c523e021b6..71f892efc0 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__hash_table +++ b/contrib/libs/cxxsupp/libcxx/include/__hash_table @@ -295,9 +295,7 @@ public: typedef typename _NodeTypes::__node_value_type_pointer pointer; _LIBCPP_INLINE_VISIBILITY __hash_iterator() _NOEXCEPT : __node_(nullptr) { -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__insert_i(this); -#endif + _VSTD::__debug_db_insert_i(this); } #if _LIBCPP_DEBUG_LEVEL == 2 @@ -407,9 +405,7 @@ public: _LIBCPP_INLINE_VISIBILITY __hash_const_iterator() _NOEXCEPT : __node_(nullptr) { -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__insert_i(this); -#endif + _VSTD::__debug_db_insert_i(this); } _LIBCPP_INLINE_VISIBILITY @@ -524,9 +520,7 @@ public: typedef typename _NodeTypes::__node_value_type_pointer pointer; _LIBCPP_INLINE_VISIBILITY __hash_local_iterator() _NOEXCEPT : __node_(nullptr) { -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__insert_i(this); -#endif + _VSTD::__debug_db_insert_i(this); } #if _LIBCPP_DEBUG_LEVEL == 2 @@ -658,9 +652,7 @@ public: _LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator() _NOEXCEPT : __node_(nullptr) { -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__insert_i(this); -#endif + _VSTD::__debug_db_insert_i(this); } _LIBCPP_INLINE_VISIBILITY diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/move_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/move_iterator.h index eac9264df3..306ce240ba 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__iterator/move_iterator.h +++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/move_iterator.h @@ -23,19 +23,20 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _Iter> class _LIBCPP_TEMPLATE_VIS move_iterator { -private: - _Iter __i; public: - typedef _Iter iterator_type; +#if _LIBCPP_STD_VER > 17 + typedef input_iterator_tag iterator_concept; +#endif + + typedef _Iter iterator_type; + typedef _If< + __is_cpp17_random_access_iterator<_Iter>::value, + random_access_iterator_tag, + typename iterator_traits<_Iter>::iterator_category + > iterator_category; typedef typename iterator_traits<iterator_type>::value_type value_type; typedef typename iterator_traits<iterator_type>::difference_type difference_type; typedef iterator_type pointer; - typedef _If<__is_cpp17_random_access_iterator<_Iter>::value, - random_access_iterator_tag, - typename iterator_traits<_Iter>::iterator_category> iterator_category; -#if _LIBCPP_STD_VER > 17 - typedef input_iterator_tag iterator_concept; -#endif #ifndef _LIBCPP_CXX03_LANG typedef typename iterator_traits<iterator_type>::reference __reference; @@ -48,114 +49,113 @@ public: typedef typename iterator_traits<iterator_type>::reference reference; #endif - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - move_iterator() : __i() {} + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 + move_iterator() : __current_() {} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - explicit move_iterator(_Iter __x) : __i(__x) {} + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 + explicit move_iterator(_Iter __i) : __current_(__i) {} template <class _Up, class = __enable_if_t< - !is_same<_Up, _Iter>::value && is_convertible<_Up const&, _Iter>::value + !is_same<_Up, _Iter>::value && is_convertible<const _Up&, _Iter>::value > > - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - move_iterator(const move_iterator<_Up>& __u) : __i(__u.base()) {} + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 + move_iterator(const move_iterator<_Up>& __u) : __current_(__u.base()) {} template <class _Up, class = __enable_if_t< !is_same<_Up, _Iter>::value && - is_convertible<_Up const&, _Iter>::value && - is_assignable<_Iter&, _Up const&>::value + is_convertible<const _Up&, _Iter>::value && + is_assignable<_Iter&, const _Up&>::value > > - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 move_iterator& operator=(const move_iterator<_Up>& __u) { - __i = __u.base(); + __current_ = __u.base(); return *this; } - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 _Iter base() const {return __i;} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - reference operator*() const { return static_cast<reference>(*__i); } - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - pointer operator->() const { return __i;} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - move_iterator& operator++() {++__i; return *this;} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - move_iterator operator++(int) {move_iterator __tmp(*this); ++__i; return __tmp;} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - move_iterator& operator--() {--__i; return *this;} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - move_iterator operator--(int) {move_iterator __tmp(*this); --__i; return __tmp;} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - move_iterator operator+ (difference_type __n) const {return move_iterator(__i + __n);} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - move_iterator& operator+=(difference_type __n) {__i += __n; return *this;} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - move_iterator operator- (difference_type __n) const {return move_iterator(__i - __n);} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - move_iterator& operator-=(difference_type __n) {__i -= __n; return *this;} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - reference operator[](difference_type __n) const { return static_cast<reference>(__i[__n]); } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 + _Iter base() const { return __current_; } + + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 + reference operator*() const { return static_cast<reference>(*__current_); } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 + pointer operator->() const { return __current_; } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 + reference operator[](difference_type __n) const { return static_cast<reference>(__current_[__n]); } + + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 + move_iterator& operator++() { ++__current_; return *this; } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 + move_iterator operator++(int) { move_iterator __tmp(*this); ++__current_; return __tmp; } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 + move_iterator& operator--() { --__current_; return *this; } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 + move_iterator operator--(int) { move_iterator __tmp(*this); --__current_; return __tmp; } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 + move_iterator operator+(difference_type __n) const { return move_iterator(__current_ + __n); } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 + move_iterator& operator+=(difference_type __n) { __current_ += __n; return *this; } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 + move_iterator operator-(difference_type __n) const { return move_iterator(__current_ - __n); } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 + move_iterator& operator-=(difference_type __n) { __current_ -= __n; return *this; } + +private: + _Iter __current_; }; template <class _Iter1, class _Iter2> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 -bool -operator==(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 +bool operator==(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) { return __x.base() == __y.base(); } template <class _Iter1, class _Iter2> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 -bool -operator<(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 +bool operator!=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) { - return __x.base() < __y.base(); + return __x.base() != __y.base(); } template <class _Iter1, class _Iter2> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 -bool -operator!=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 +bool operator<(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) { - return __x.base() != __y.base(); + return __x.base() < __y.base(); } template <class _Iter1, class _Iter2> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 -bool -operator>(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 +bool operator>(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) { return __x.base() > __y.base(); } template <class _Iter1, class _Iter2> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 -bool -operator>=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 +bool operator<=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) { - return __x.base() >= __y.base(); + return __x.base() <= __y.base(); } template <class _Iter1, class _Iter2> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 -bool -operator<=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 +bool operator>=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) { - return __x.base() <= __y.base(); + return __x.base() >= __y.base(); } #ifndef _LIBCPP_CXX03_LANG template <class _Iter1, class _Iter2> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 -auto -operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) --> decltype(__x.base() - __y.base()) +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 +auto operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) + -> decltype(__x.base() - __y.base()) { return __x.base() - __y.base(); } #else template <class _Iter1, class _Iter2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_HIDE_FROM_ABI typename move_iterator<_Iter1>::difference_type operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) { @@ -164,7 +164,7 @@ operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) #endif template <class _Iter> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 move_iterator<_Iter> operator+(typename move_iterator<_Iter>::difference_type __n, const move_iterator<_Iter>& __x) { @@ -172,7 +172,7 @@ operator+(typename move_iterator<_Iter>::difference_type __n, const move_iterato } template <class _Iter> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 move_iterator<_Iter> make_move_iterator(_Iter __i) { diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/reverse_iterator.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/reverse_iterator.h index 7807b803df..454054534e 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__iterator/reverse_iterator.h +++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/reverse_iterator.h @@ -24,13 +24,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD -template <class _Tp, class = void> -struct __is_stashing_iterator : false_type {}; - -template <class _Tp> -struct __is_stashing_iterator<_Tp, typename __void_t<typename _Tp::__stashing_iterator_tag>::type> - : true_type {}; - _LIBCPP_SUPPRESS_DEPRECATED_PUSH template <class _Iter> class _LIBCPP_TEMPLATE_VIS reverse_iterator @@ -48,10 +41,6 @@ private: _Iter __t; // no longer used as of LWG #2360, not removed due to ABI break #endif - static_assert(!__is_stashing_iterator<_Iter>::value, - "The specified iterator type cannot be used with reverse_iterator; " - "Using stashing iterators with reverse_iterator causes undefined behavior"); - protected: _Iter current; public: diff --git a/contrib/libs/cxxsupp/libcxx/include/__iterator/wrap_iter.h b/contrib/libs/cxxsupp/libcxx/include/__iterator/wrap_iter.h index 1408c673bc..d9dbee5888 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__iterator/wrap_iter.h +++ b/contrib/libs/cxxsupp/libcxx/include/__iterator/wrap_iter.h @@ -43,10 +43,7 @@ public: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __wrap_iter() _NOEXCEPT : __i() { -#if _LIBCPP_DEBUG_LEVEL == 2 - if (!__libcpp_is_constant_evaluated()) - __get_db()->__insert_i(this); -#endif + _VSTD::__debug_db_insert_i(this); } template <class _Up> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __wrap_iter(const __wrap_iter<_Up>& __u, diff --git a/contrib/libs/cxxsupp/libcxx/include/__locale b/contrib/libs/cxxsupp/libcxx/include/__locale index b1c277f76b..0cde655a63 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__locale +++ b/contrib/libs/cxxsupp/libcxx/include/__locale @@ -517,6 +517,33 @@ public: # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_PRINT # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_ALPHA # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_XDIGIT +#elif defined(__MVS__) + static const mask __regex_word = 0x8000; +# if defined(__NATIVE_ASCII_F)` + typedef unsigned int mask; + static const mask space = _ISSPACE_A; + static const mask print = _ISPRINT_A; + static const mask cntrl = _ISCNTRL_A; + static const mask upper = _ISUPPER_A; + static const mask lower = _ISLOWER_A; + static const mask alpha = _ISALPHA_A; + static const mask digit = _ISDIGIT_A; + static const mask punct = _ISPUNCT_A; + static const mask xdigit = _ISXDIGIT_A; + static const mask blank = _ISBLANK_A; +# else + typedef unsigned short mask; + static const mask space = __ISSPACE; + static const mask print = __ISPRINT; + static const mask cntrl = __ISCNTRL; + static const mask upper = __ISUPPER; + static const mask lower = __ISLOWER; + static const mask alpha = __ISALPHA; + static const mask digit = __ISDIGIT; + static const mask punct = __ISPUNCT; + static const mask xdigit = __ISXDIGIT; + static const mask blank = __ISBLANK; +# endif #else # error unknown rune table for this platform -- do you mean to define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE? #endif @@ -740,6 +767,10 @@ public: static const short* __classic_upper_table() _NOEXCEPT; static const short* __classic_lower_table() _NOEXCEPT; #endif +#if defined(__MVS__) + static const unsigned short* __classic_upper_table() _NOEXCEPT; + static const unsigned short* __classic_lower_table() _NOEXCEPT; +#endif protected: ~ctype(); diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/ranges_construct_at.h b/contrib/libs/cxxsupp/libcxx/include/__memory/ranges_construct_at.h index 99ae299089..9b0edb7c25 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__memory/ranges_construct_at.h +++ b/contrib/libs/cxxsupp/libcxx/include/__memory/ranges_construct_at.h @@ -38,9 +38,7 @@ namespace ranges { namespace __construct_at { struct __fn final : private __function_like { - - _LIBCPP_HIDE_FROM_ABI - constexpr explicit __fn(__tag __x) noexcept : __function_like(__x) {} + _LIBCPP_HIDE_FROM_ABI constexpr explicit __fn(__tag __x) noexcept : __function_like(__x) {} template<class _Tp, class... _Args, class = decltype( ::new (declval<void*>()) _Tp(declval<_Args>()...) @@ -49,13 +47,12 @@ struct __fn final : private __function_like { constexpr _Tp* operator()(_Tp* __location, _Args&& ...__args) const { return _VSTD::construct_at(__location, _VSTD::forward<_Args>(__args)...); } - }; } // namespace __construct_at inline namespace __cpo { -inline constexpr auto construct_at = __construct_at::__fn(__function_like::__tag()); + inline constexpr auto construct_at = __construct_at::__fn(__function_like::__tag()); } // namespace __cpo // destroy_at @@ -63,22 +60,19 @@ inline constexpr auto construct_at = __construct_at::__fn(__function_like::__tag namespace __destroy_at { struct __fn final : private __function_like { - - _LIBCPP_HIDE_FROM_ABI - constexpr explicit __fn(__tag __x) noexcept : __function_like(__x) {} + _LIBCPP_HIDE_FROM_ABI constexpr explicit __fn(__tag __x) noexcept : __function_like(__x) {} template <destructible _Tp> _LIBCPP_HIDE_FROM_ABI constexpr void operator()(_Tp* __location) const noexcept { _VSTD::destroy_at(__location); } - }; } // namespace __destroy_at inline namespace __cpo { -inline constexpr auto destroy_at = __destroy_at::__fn(__function_like::__tag()); + inline constexpr auto destroy_at = __destroy_at::__fn(__function_like::__tag()); } // namespace __cpo // destroy @@ -86,9 +80,7 @@ inline constexpr auto destroy_at = __destroy_at::__fn(__function_like::__tag()); namespace __destroy { struct __fn final : private __function_like { - - _LIBCPP_HIDE_FROM_ABI - constexpr explicit __fn(__tag __x) noexcept : __function_like(__x) {} + _LIBCPP_HIDE_FROM_ABI constexpr explicit __fn(__tag __x) noexcept : __function_like(__x) {} template <__nothrow_input_iterator _InputIterator, __nothrow_sentinel_for<_InputIterator> _Sentinel> requires destructible<iter_value_t<_InputIterator>> @@ -103,13 +95,12 @@ struct __fn final : private __function_like { constexpr borrowed_iterator_t<_InputRange> operator()(_InputRange&& __range) const noexcept { return (*this)(ranges::begin(__range), ranges::end(__range)); } - }; } // namespace __destroy inline namespace __cpo { -inline constexpr auto destroy = __destroy::__fn(__function_like::__tag()); + inline constexpr auto destroy = __destroy::__fn(__function_like::__tag()); } // namespace __cpo // destroy_n @@ -117,9 +108,7 @@ inline constexpr auto destroy = __destroy::__fn(__function_like::__tag()); namespace __destroy_n { struct __fn final : private __function_like { - - _LIBCPP_HIDE_FROM_ABI - constexpr explicit __fn(__tag __x) noexcept : __function_like(__x) {} + _LIBCPP_HIDE_FROM_ABI constexpr explicit __fn(__tag __x) noexcept : __function_like(__x) {} template <__nothrow_input_iterator _InputIterator> requires destructible<iter_value_t<_InputIterator>> @@ -127,13 +116,12 @@ struct __fn final : private __function_like { constexpr _InputIterator operator()(_InputIterator __first, iter_difference_t<_InputIterator> __n) const noexcept { return _VSTD::destroy_n(_VSTD::move(__first), __n); } - }; } // namespace __destroy_n inline namespace __cpo { -inline constexpr auto destroy_n = __destroy_n::__fn(__function_like::__tag()); + inline constexpr auto destroy_n = __destroy_n::__fn(__function_like::__tag()); } // namespace __cpo } // namespace ranges diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/ranges_uninitialized_algorithms.h b/contrib/libs/cxxsupp/libcxx/include/__memory/ranges_uninitialized_algorithms.h index 09786ffc69..8cd2748e45 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__memory/ranges_uninitialized_algorithms.h +++ b/contrib/libs/cxxsupp/libcxx/include/__memory/ranges_uninitialized_algorithms.h @@ -41,7 +41,6 @@ namespace ranges { namespace __uninitialized_default_construct { struct __fn final : private __function_like { - constexpr explicit __fn(__tag __x) noexcept : __function_like(__x) {} template <__nothrow_forward_iterator _ForwardIterator, @@ -58,14 +57,12 @@ struct __fn final : private __function_like { borrowed_iterator_t<_ForwardRange> operator()(_ForwardRange&& __range) const { return (*this)(ranges::begin(__range), ranges::end(__range)); } - }; } // namespace __uninitialized_default_construct inline namespace __cpo { - inline constexpr auto uninitialized_default_construct = - __uninitialized_default_construct::__fn(__function_like::__tag()); + inline constexpr auto uninitialized_default_construct = __uninitialized_default_construct::__fn(__function_like::__tag()); } // namespace __cpo // uninitialized_default_construct_n @@ -73,9 +70,7 @@ inline namespace __cpo { namespace __uninitialized_default_construct_n { struct __fn final : private __function_like { - - constexpr explicit __fn(__tag __x) noexcept : - __function_like(__x) {} + constexpr explicit __fn(__tag __x) noexcept : __function_like(__x) {} template <__nothrow_forward_iterator _ForwardIterator> requires default_initializable<iter_value_t<_ForwardIterator>> @@ -84,7 +79,6 @@ struct __fn final : private __function_like { using _ValueType = remove_reference_t<iter_reference_t<_ForwardIterator>>; return _VSTD::__uninitialized_default_construct_n<_ValueType>(_VSTD::move(__first), __n); } - }; } // namespace __uninitialized_default_construct_n @@ -215,10 +209,8 @@ using uninitialized_copy_result = in_out_result<_InputIterator, _OutputIterator> namespace __uninitialized_copy { struct __fn final : private __function_like { - constexpr explicit __fn(__tag __x) noexcept : __function_like(__x) {} - // clang-format off template <input_iterator _InputIterator, sentinel_for<_InputIterator> _Sentinel1, __nothrow_forward_iterator _OutputIterator, @@ -226,7 +218,6 @@ struct __fn final : private __function_like { requires constructible_from<iter_value_t<_OutputIterator>, iter_reference_t<_InputIterator>> uninitialized_copy_result<_InputIterator, _OutputIterator> operator()(_InputIterator __ifirst, _Sentinel1 __ilast, _OutputIterator __ofirst, _Sentinel2 __olast) const { - // clang-format on using _ValueType = remove_reference_t<iter_reference_t<_OutputIterator>>; auto __result = _VSTD::__uninitialized_copy<_ValueType>(_VSTD::move(__ifirst), _VSTD::move(__ilast), @@ -234,14 +225,12 @@ struct __fn final : private __function_like { return {_VSTD::move(__result.first), _VSTD::move(__result.second)}; } - // clang-format off template <input_range _InputRange, __nothrow_forward_range _OutputRange> requires constructible_from<range_value_t<_OutputRange>, range_reference_t<_InputRange>> uninitialized_copy_result<borrowed_iterator_t<_InputRange>, borrowed_iterator_t<_OutputRange>> operator()( _InputRange&& __in_range, _OutputRange&& __out_range) const { - // clang-format on - return (*this)(ranges::begin(__in_range), ranges::end(__in_range), ranges::begin(__out_range), - ranges::end(__out_range)); + return (*this)(ranges::begin(__in_range), ranges::end(__in_range), + ranges::begin(__out_range), ranges::end(__out_range)); } }; @@ -259,10 +248,8 @@ using uninitialized_copy_n_result = in_out_result<_InputIterator, _OutputIterato namespace __uninitialized_copy_n { struct __fn final : private __function_like { - constexpr explicit __fn(__tag __x) noexcept : __function_like(__x) {} - // clang-format off template <input_iterator _InputIterator, __nothrow_forward_iterator _OutputIterator, __nothrow_sentinel_for<_OutputIterator> _Sentinel> @@ -270,14 +257,11 @@ struct __fn final : private __function_like { uninitialized_copy_n_result<_InputIterator, _OutputIterator> operator()(_InputIterator __ifirst, iter_difference_t<_InputIterator> __n, _OutputIterator __ofirst, _Sentinel __olast) const { - // clang-format on using _ValueType = remove_reference_t<iter_reference_t<_OutputIterator>>; - - auto __result = _VSTD::__uninitialized_copy_n<_ValueType>(_VSTD::move(__ifirst), __n, _VSTD::move(__ofirst), - _VSTD::move(__olast)); + auto __result = _VSTD::__uninitialized_copy_n<_ValueType>(_VSTD::move(__ifirst), __n, + _VSTD::move(__ofirst), _VSTD::move(__olast)); return {_VSTD::move(__result.first), _VSTD::move(__result.second)}; } - }; } // namespace __uninitialized_copy_n @@ -294,10 +278,8 @@ using uninitialized_move_result = in_out_result<_InputIterator, _OutputIterator> namespace __uninitialized_move { struct __fn final : private __function_like { - constexpr explicit __fn(__tag __x) noexcept : __function_like(__x) {} - // clang-format off template <input_iterator _InputIterator, sentinel_for<_InputIterator> _Sentinel1, __nothrow_forward_iterator _OutputIterator, @@ -305,7 +287,6 @@ struct __fn final : private __function_like { requires constructible_from<iter_value_t<_OutputIterator>, iter_reference_t<_InputIterator>> uninitialized_move_result<_InputIterator, _OutputIterator> operator()(_InputIterator __ifirst, _Sentinel1 __ilast, _OutputIterator __ofirst, _Sentinel2 __olast) const { - // clang-format on using _ValueType = remove_reference_t<iter_reference_t<_OutputIterator>>; auto __iter_move = [](auto&& __iter) -> decltype(auto) { return ranges::iter_move(__iter); }; @@ -314,16 +295,13 @@ struct __fn final : private __function_like { return {_VSTD::move(__result.first), _VSTD::move(__result.second)}; } - // clang-format off template <input_range _InputRange, __nothrow_forward_range _OutputRange> requires constructible_from<range_value_t<_OutputRange>, range_reference_t<_InputRange>> uninitialized_move_result<borrowed_iterator_t<_InputRange>, borrowed_iterator_t<_OutputRange>> operator()(_InputRange&& __in_range, _OutputRange&& __out_range) const { - // clang-format on - return (*this)(ranges::begin(__in_range), ranges::end(__in_range), ranges::begin(__out_range), - ranges::end(__out_range)); + return (*this)(ranges::begin(__in_range), ranges::end(__in_range), + ranges::begin(__out_range), ranges::end(__out_range)); } - }; } // namespace __uninitialized_move @@ -340,18 +318,15 @@ using uninitialized_move_n_result = in_out_result<_InputIterator, _OutputIterato namespace __uninitialized_move_n { struct __fn final : private __function_like { - constexpr explicit __fn(__tag __x) noexcept : __function_like(__x) {} - // clang-format off template <input_iterator _InputIterator, __nothrow_forward_iterator _OutputIterator, __nothrow_sentinel_for<_OutputIterator> _Sentinel> requires constructible_from<iter_value_t<_OutputIterator>, iter_reference_t<_InputIterator>> uninitialized_move_n_result<_InputIterator, _OutputIterator> - operator()(_InputIterator __ifirst, iter_difference_t<_InputIterator> __n, _OutputIterator __ofirst, - _Sentinel __olast) const { - // clang-format on + operator()(_InputIterator __ifirst, iter_difference_t<_InputIterator> __n, + _OutputIterator __ofirst, _Sentinel __olast) const { using _ValueType = remove_reference_t<iter_reference_t<_OutputIterator>>; auto __iter_move = [](auto&& __iter) -> decltype(auto) { return ranges::iter_move(__iter); }; @@ -359,7 +334,6 @@ struct __fn final : private __function_like { _VSTD::move(__olast), __iter_move); return {_VSTD::move(__result.first), _VSTD::move(__result.second)}; } - }; } // namespace __uninitialized_move_n diff --git a/contrib/libs/cxxsupp/libcxx/include/__random/lognormal_distribution.h b/contrib/libs/cxxsupp/libcxx/include/__random/lognormal_distribution.h index 752861c3de..8fadb5a1e6 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__random/lognormal_distribution.h +++ b/contrib/libs/cxxsupp/libcxx/include/__random/lognormal_distribution.h @@ -24,6 +24,8 @@ _LIBCPP_PUSH_MACROS _LIBCPP_BEGIN_NAMESPACE_STD +#ifdef _LIBCPP_ABI_OLD_LOGNORMAL_DISTRIBUTION + template<class _RealType = double> class _LIBCPP_TEMPLATE_VIS lognormal_distribution { @@ -156,6 +158,140 @@ operator>>(basic_istream<_CharT, _Traits>& __is, return __is >> __x.__p_.__nd_; } +#else // _LIBCPP_ABI_OLD_LOGNORMAL_DISTRIBUTION + +template<class _RealType = double> +class _LIBCPP_TEMPLATE_VIS lognormal_distribution +{ +public: + // types + typedef _RealType result_type; + + class _LIBCPP_TEMPLATE_VIS param_type + { + result_type __m_; + result_type __s_; + public: + typedef lognormal_distribution distribution_type; + + _LIBCPP_INLINE_VISIBILITY + explicit param_type(result_type __m = 0, result_type __s = 1) + : __m_(__m), __s_(__s) {} + + _LIBCPP_INLINE_VISIBILITY + result_type m() const {return __m_;} + _LIBCPP_INLINE_VISIBILITY + result_type s() const {return __s_;} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const param_type& __x, const param_type& __y) + {return __x.__m_ == __y.__m_ && __x.__s_ == __y.__s_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const param_type& __x, const param_type& __y) + {return !(__x == __y);} + }; + +private: + normal_distribution<result_type> __nd_; + +public: + // constructor and reset functions +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + lognormal_distribution() : lognormal_distribution(0) {} + _LIBCPP_INLINE_VISIBILITY + explicit lognormal_distribution(result_type __m, result_type __s = 1) + : __nd_(__m, __s) {} +#else + _LIBCPP_INLINE_VISIBILITY + explicit lognormal_distribution(result_type __m = 0, + result_type __s = 1) + : __nd_(__m, __s) {} +#endif + _LIBCPP_INLINE_VISIBILITY + explicit lognormal_distribution(const param_type& __p) + : __nd_(__p.m(), __p.s()) {} + _LIBCPP_INLINE_VISIBILITY + void reset() {__nd_.reset();} + + // generating functions + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g) + { + return _VSTD::exp(__nd_(__g)); + } + + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g, const param_type& __p) + { + typename normal_distribution<result_type>::param_type __pn(__p.m(), __p.s()); + return _VSTD::exp(__nd_(__g, __pn)); + } + + // property functions + _LIBCPP_INLINE_VISIBILITY + result_type m() const {return __nd_.mean();} + _LIBCPP_INLINE_VISIBILITY + result_type s() const {return __nd_.stddev();} + + _LIBCPP_INLINE_VISIBILITY + param_type param() const {return param_type(__nd_.mean(), __nd_.stddev());} + _LIBCPP_INLINE_VISIBILITY + void param(const param_type& __p) + { + typename normal_distribution<result_type>::param_type __pn(__p.m(), __p.s()); + __nd_.param(__pn); + } + + _LIBCPP_INLINE_VISIBILITY + result_type min() const {return 0;} + _LIBCPP_INLINE_VISIBILITY + result_type max() const {return numeric_limits<result_type>::infinity();} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const lognormal_distribution& __x, + const lognormal_distribution& __y) + {return __x.__nd_ == __y.__nd_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const lognormal_distribution& __x, + const lognormal_distribution& __y) + {return !(__x == __y);} + + template <class _CharT, class _Traits, class _RT> + friend + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __os, + const lognormal_distribution<_RT>& __x); + + template <class _CharT, class _Traits, class _RT> + friend + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __is, + lognormal_distribution<_RT>& __x); +}; + +template <class _CharT, class _Traits, class _RT> +inline _LIBCPP_INLINE_VISIBILITY +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const lognormal_distribution<_RT>& __x) +{ + return __os << __x.__nd_; +} + +template <class _CharT, class _Traits, class _RT> +inline _LIBCPP_INLINE_VISIBILITY +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + lognormal_distribution<_RT>& __x) +{ + return __is >> __x.__nd_; +} + +#endif // _LIBCPP_ABI_OLD_LOGNORMAL_DISTRIBUTION + _LIBCPP_END_NAMESPACE_STD _LIBCPP_POP_MACROS diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/concepts.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/concepts.h index fa31074ab6..a9cb15f9f1 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/concepts.h +++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/concepts.h @@ -83,11 +83,11 @@ namespace ranges { movable<_Tp> && enable_view<_Tp>; - template<class _Range> + template <class _Range> concept __simple_view = view<_Range> && range<const _Range> && same_as<iterator_t<_Range>, iterator_t<const _Range>> && - same_as<sentinel_t<_Range>, iterator_t<const _Range>>; + same_as<sentinel_t<_Range>, sentinel_t<const _Range>>; // [range.refinements], other range refinements template <class _Rp, class _Tp> diff --git a/contrib/libs/cxxsupp/libcxx/include/__support/win32/limits_msvc_win32.h b/contrib/libs/cxxsupp/libcxx/include/__support/win32/limits_msvc_win32.h index d0903357da..9f693d9fa4 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__support/win32/limits_msvc_win32.h +++ b/contrib/libs/cxxsupp/libcxx/include/__support/win32/limits_msvc_win32.h @@ -14,7 +14,7 @@ #error "This header complements the Microsoft C Runtime library, and should not be included otherwise." #endif #if defined(__clang__) -#error "This header should only be included when using Microsofts C1XX frontend" +#error "This header should only be included when using Microsoft's C1XX frontend" #endif #include <float.h> // limit constants diff --git a/contrib/libs/cxxsupp/libcxx/include/__thread/timed_backoff_policy.h b/contrib/libs/cxxsupp/libcxx/include/__thread/timed_backoff_policy.h new file mode 100644 index 0000000000..d85a34071c --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__thread/timed_backoff_policy.h @@ -0,0 +1,45 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___THREAD_TIMED_BACKOFF_POLICY_H +#define _LIBCPP___THREAD_TIMED_BACKOFF_POLICY_H + +#include <__config> + +#ifndef _LIBCPP_HAS_NO_THREADS + +#include <__threading_support> +#include <chrono> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +struct __libcpp_timed_backoff_policy { + _LIBCPP_INLINE_VISIBILITY + bool operator()(chrono::nanoseconds __elapsed) const + { + if(__elapsed > chrono::milliseconds(128)) + __libcpp_thread_sleep_for(chrono::milliseconds(8)); + else if(__elapsed > chrono::microseconds(64)) + __libcpp_thread_sleep_for(__elapsed / 2); + else if(__elapsed > chrono::microseconds(4)) + __libcpp_thread_yield(); + else + {} // poll + return false; + } +}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP_HAS_NO_THREADS + +#endif // _LIBCPP___THREAD_TIMED_BACKOFF_POLICY_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__threading_support b/contrib/libs/cxxsupp/libcxx/include/__threading_support index 89ea4a9169..b4675aadf0 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__threading_support +++ b/contrib/libs/cxxsupp/libcxx/include/__threading_support @@ -56,9 +56,6 @@ typedef ::timespec __libcpp_timespec_t; #endif // !defined(_LIBCPP_HAS_NO_THREADS) -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - _LIBCPP_BEGIN_NAMESPACE_STD #if !defined(_LIBCPP_HAS_NO_THREADS) @@ -254,53 +251,9 @@ int __libcpp_tls_set(__libcpp_tls_key __key, void *__p); #endif // !defined(_LIBCPP_HAS_THREAD_API_EXTERNAL) -struct __libcpp_timed_backoff_policy { - _LIBCPP_INLINE_VISIBILITY - bool operator()(chrono::nanoseconds __elapsed) const - { - if(__elapsed > chrono::milliseconds(128)) - __libcpp_thread_sleep_for(chrono::milliseconds(8)); - else if(__elapsed > chrono::microseconds(64)) - __libcpp_thread_sleep_for(__elapsed / 2); - else if(__elapsed > chrono::microseconds(4)) - __libcpp_thread_yield(); - else - {} // poll - return false; - } -}; - #if (!defined(_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) || \ defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL)) - -namespace __thread_detail { - -_LIBCPP_HIDE_FROM_ABI inline -__libcpp_timespec_t __convert_to_timespec(const chrono::nanoseconds& __ns) -{ - using namespace chrono; - seconds __s = duration_cast<seconds>(__ns); - __libcpp_timespec_t __ts; - typedef decltype(__ts.tv_sec) __ts_sec; - const __ts_sec __ts_sec_max = numeric_limits<__ts_sec>::max(); - - if (__s.count() < __ts_sec_max) - { - __ts.tv_sec = static_cast<__ts_sec>(__s.count()); - __ts.tv_nsec = static_cast<decltype(__ts.tv_nsec)>((__ns - __s).count()); - } - else - { - __ts.tv_sec = __ts_sec_max; - __ts.tv_nsec = 999999999; // (10^9 - 1) - } - - return __ts; -} - -} // namespace __thread_detail - #if defined(_LIBCPP_HAS_THREAD_API_PTHREAD) _LIBCPP_HIDE_FROM_ABI inline @@ -481,7 +434,7 @@ void __libcpp_thread_yield() _LIBCPP_HIDE_FROM_ABI inline void __libcpp_thread_sleep_for(const chrono::nanoseconds& __ns) { - __libcpp_timespec_t __ts = __thread_detail::__convert_to_timespec(__ns); + __libcpp_timespec_t __ts = _VSTD::__convert_to_timespec<__libcpp_timespec_t>(__ns); while (nanosleep(&__ts, &__ts) == -1 && errno == EINTR); } @@ -666,7 +619,7 @@ void __libcpp_thread_yield() _LIBCPP_HIDE_FROM_ABI inline void __libcpp_thread_sleep_for(const chrono::nanoseconds& __ns) { - __libcpp_timespec_t __ts = __thread_detail::__convert_to_timespec(__ns); + __libcpp_timespec_t __ts = _VSTD::__convert_to_timespec<__libcpp_timespec_t>(__ns); thrd_sleep(&__ts, nullptr); } @@ -778,6 +731,4 @@ get_id() _NOEXCEPT _LIBCPP_END_NAMESPACE_STD -_LIBCPP_POP_MACROS - #endif // _LIBCPP_THREADING_SUPPORT diff --git a/contrib/libs/cxxsupp/libcxx/include/atomic b/contrib/libs/cxxsupp/libcxx/include/atomic index a2230de042..89f3c0a1de 100644 --- a/contrib/libs/cxxsupp/libcxx/include/atomic +++ b/contrib/libs/cxxsupp/libcxx/include/atomic @@ -521,6 +521,7 @@ template <class T> #include <__availability> #include <__config> #include <__thread/poll_with_backoff.h> +#include <__thread/timed_backoff_policy.h> #include <cstddef> #include <cstdint> #include <cstring> diff --git a/contrib/libs/cxxsupp/libcxx/include/barrier b/contrib/libs/cxxsupp/libcxx/include/barrier index 555fdacd3b..0e780cce8e 100644 --- a/contrib/libs/cxxsupp/libcxx/include/barrier +++ b/contrib/libs/cxxsupp/libcxx/include/barrier @@ -47,6 +47,7 @@ namespace std #include <__availability> #include <__config> +#include <__thread/timed_backoff_policy.h> #include <atomic> #ifndef _LIBCPP_HAS_NO_TREE_BARRIER # include <memory> diff --git a/contrib/libs/cxxsupp/libcxx/include/chrono b/contrib/libs/cxxsupp/libcxx/include/chrono index ee2d63cda7..eada2b8520 100644 --- a/contrib/libs/cxxsupp/libcxx/include/chrono +++ b/contrib/libs/cxxsupp/libcxx/include/chrono @@ -695,6 +695,7 @@ constexpr chrono::year operator ""y(unsigned lo */ #include <__chrono/calendar.h> +#include <__chrono/convert_to_timespec.h> #include <__chrono/duration.h> #include <__chrono/file_clock.h> #include <__chrono/high_resolution_clock.h> diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/simd b/contrib/libs/cxxsupp/libcxx/include/experimental/simd index af7e66eb8b..475155512d 100644 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/simd +++ b/contrib/libs/cxxsupp/libcxx/include/experimental/simd @@ -689,7 +689,7 @@ class __simd_storage<_Tp, __simd_abi<_StorageKind::_Array, __num_element>> { friend struct simd_mask; public: - _Tp __get(size_t __index) const noexcept { return __storage_[__index]; }; + _Tp __get(size_t __index) const noexcept { return __storage_[__index]; } void __set(size_t __index, _Tp __val) noexcept { __storage_[__index] = __val; } @@ -706,7 +706,7 @@ class __simd_storage<_Tp, __simd_abi<_StorageKind::_Scalar, 1>> { friend struct simd_mask; public: - _Tp __get(size_t __index) const noexcept { return (&__storage_)[__index]; }; + _Tp __get(size_t __index) const noexcept { return (&__storage_)[__index]; } void __set(size_t __index, _Tp __val) noexcept { (&__storage_)[__index] = __val; } @@ -770,7 +770,7 @@ struct __vec_ext_traits { _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 29); \ _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 30); \ _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 31); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 32); + _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 32) _LIBCPP_SPECIALIZE_VEC_EXT_32(char); _LIBCPP_SPECIALIZE_VEC_EXT_32(char16_t); @@ -808,7 +808,7 @@ class __simd_storage<_Tp, __simd_abi<_StorageKind::_VecExt, __num_element>> { friend struct simd_mask; public: - _Tp __get(size_t __index) const noexcept { return __storage_[__index]; }; + _Tp __get(size_t __index) const noexcept { return __storage_[__index]; } void __set(size_t __index, _Tp __val) noexcept { __storage_[__index] = __val; } diff --git a/contrib/libs/cxxsupp/libcxx/include/list b/contrib/libs/cxxsupp/libcxx/include/list index 7e1c7549e0..94f5359382 100644 --- a/contrib/libs/cxxsupp/libcxx/include/list +++ b/contrib/libs/cxxsupp/libcxx/include/list @@ -319,9 +319,7 @@ public: _LIBCPP_INLINE_VISIBILITY __list_iterator() _NOEXCEPT : __ptr_(nullptr) { -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__insert_i(this); -#endif + _VSTD::__debug_db_insert_i(this); } #if _LIBCPP_DEBUG_LEVEL == 2 @@ -431,9 +429,7 @@ public: _LIBCPP_INLINE_VISIBILITY __list_const_iterator() _NOEXCEPT : __ptr_(nullptr) { -#if _LIBCPP_DEBUG_LEVEL == 2 - __get_db()->__insert_i(this); -#endif + _VSTD::__debug_db_insert_i(this); } _LIBCPP_INLINE_VISIBILITY __list_const_iterator(const __list_iterator<_Tp, _VoidPtr>& __p) _NOEXCEPT diff --git a/contrib/libs/cxxsupp/libcxx/include/locale b/contrib/libs/cxxsupp/libcxx/include/locale index 91749f768a..b7df22924d 100644 --- a/contrib/libs/cxxsupp/libcxx/include/locale +++ b/contrib/libs/cxxsupp/libcxx/include/locale @@ -416,11 +416,11 @@ struct __num_get unsigned& __dc, _CharT __thousands_sep, const string& __grouping, unsigned* __g, unsigned*& __g_end, const _CharT* __atoms); private: - template<typename T> - const T* __do_widen_p(ios_base& __iob, T* __atoms) const + template<typename _Tp> + const _Tp* __do_widen_p(ios_base& __iob, _Tp* __atoms) const { locale __loc = __iob.getloc(); - use_facet<ctype<T> >(__loc).widen(__src, __src + 26, __atoms); + use_facet<ctype<_Tp> >(__loc).widen(__src, __src + 26, __atoms); return __atoms; } diff --git a/contrib/libs/cxxsupp/libcxx/include/module.modulemap b/contrib/libs/cxxsupp/libcxx/include/module.modulemap index 33e0ecf699..c17ecc98aa 100644 --- a/contrib/libs/cxxsupp/libcxx/include/module.modulemap +++ b/contrib/libs/cxxsupp/libcxx/include/module.modulemap @@ -367,6 +367,7 @@ module std [system] { module __chrono { module calendar { private header "__chrono/calendar.h" } + module convert_to_timespec { private header "__chrono/convert_to_timespec.h" } module duration { private header "__chrono/duration.h" } module file_clock { private header "__chrono/file_clock.h" } module high_resolution_clock { private header "__chrono/high_resolution_clock.h" } @@ -902,7 +903,8 @@ module std [system] { export * module __thread { - module poll_with_backoff { private header "__thread/poll_with_backoff.h" } + module poll_with_backoff { private header "__thread/poll_with_backoff.h" } + module timed_backoff_policy { private header "__thread/timed_backoff_policy.h" } } } module tuple { @@ -989,7 +991,7 @@ module std [system] { module __function_like { private header "__function_like.h" export * } module __hash_table { header "__hash_table" export * } module __locale { private header "__locale" export * } - module __mbstate { private header "__mbstate_t.h" export * } + module __mbstate_t { private header "__mbstate_t.h" export * } module __mutex_base { private header "__mutex_base" export * } module __node_handle { private header "__node_handle" export * } module __nullptr { header "__nullptr" export * } diff --git a/contrib/libs/cxxsupp/libcxx/include/numbers b/contrib/libs/cxxsupp/libcxx/include/numbers index dffb81062d..65e04e4664 100644 --- a/contrib/libs/cxxsupp/libcxx/include/numbers +++ b/contrib/libs/cxxsupp/libcxx/include/numbers @@ -73,42 +73,42 @@ _LIBCPP_BEGIN_NAMESPACE_STD namespace numbers { -template <class T> +template <class _Tp> inline constexpr bool __false = false; -template <class T> +template <class _Tp> struct __illformed { - static_assert(__false<T>, "A program that instantiates a primary template of a mathematical constant variable template is ill-formed."); + static_assert(__false<_Tp>, "A program that instantiates a primary template of a mathematical constant variable template is ill-formed."); }; -template <class T> inline constexpr T e_v = __illformed<T>{}; -template <class T> inline constexpr T log2e_v = __illformed<T>{}; -template <class T> inline constexpr T log10e_v = __illformed<T>{}; -template <class T> inline constexpr T pi_v = __illformed<T>{}; -template <class T> inline constexpr T inv_pi_v = __illformed<T>{}; -template <class T> inline constexpr T inv_sqrtpi_v = __illformed<T>{}; -template <class T> inline constexpr T ln2_v = __illformed<T>{}; -template <class T> inline constexpr T ln10_v = __illformed<T>{}; -template <class T> inline constexpr T sqrt2_v = __illformed<T>{}; -template <class T> inline constexpr T sqrt3_v = __illformed<T>{}; -template <class T> inline constexpr T inv_sqrt3_v = __illformed<T>{}; -template <class T> inline constexpr T egamma_v = __illformed<T>{}; -template <class T> inline constexpr T phi_v = __illformed<T>{}; - -template <floating_point T> inline constexpr T e_v<T> = 2.718281828459045235360287471352662L; -template <floating_point T> inline constexpr T log2e_v<T> = 1.442695040888963407359924681001892L; -template <floating_point T> inline constexpr T log10e_v<T> = 0.434294481903251827651128918916605L; -template <floating_point T> inline constexpr T pi_v<T> = 3.141592653589793238462643383279502L; -template <floating_point T> inline constexpr T inv_pi_v<T> = 0.318309886183790671537767526745028L; -template <floating_point T> inline constexpr T inv_sqrtpi_v<T> = 0.564189583547756286948079451560772L; -template <floating_point T> inline constexpr T ln2_v<T> = 0.693147180559945309417232121458176L; -template <floating_point T> inline constexpr T ln10_v<T> = 2.302585092994045684017991454684364L; -template <floating_point T> inline constexpr T sqrt2_v<T> = 1.414213562373095048801688724209698L; -template <floating_point T> inline constexpr T sqrt3_v<T> = 1.732050807568877293527446341505872L; -template <floating_point T> inline constexpr T inv_sqrt3_v<T> = 0.577350269189625764509148780501957L; -template <floating_point T> inline constexpr T egamma_v<T> = 0.577215664901532860606512090082402L; -template <floating_point T> inline constexpr T phi_v<T> = 1.618033988749894848204586834365638L; +template <class _Tp> inline constexpr _Tp e_v = __illformed<_Tp>{}; +template <class _Tp> inline constexpr _Tp log2e_v = __illformed<_Tp>{}; +template <class _Tp> inline constexpr _Tp log10e_v = __illformed<_Tp>{}; +template <class _Tp> inline constexpr _Tp pi_v = __illformed<_Tp>{}; +template <class _Tp> inline constexpr _Tp inv_pi_v = __illformed<_Tp>{}; +template <class _Tp> inline constexpr _Tp inv_sqrtpi_v = __illformed<_Tp>{}; +template <class _Tp> inline constexpr _Tp ln2_v = __illformed<_Tp>{}; +template <class _Tp> inline constexpr _Tp ln10_v = __illformed<_Tp>{}; +template <class _Tp> inline constexpr _Tp sqrt2_v = __illformed<_Tp>{}; +template <class _Tp> inline constexpr _Tp sqrt3_v = __illformed<_Tp>{}; +template <class _Tp> inline constexpr _Tp inv_sqrt3_v = __illformed<_Tp>{}; +template <class _Tp> inline constexpr _Tp egamma_v = __illformed<_Tp>{}; +template <class _Tp> inline constexpr _Tp phi_v = __illformed<_Tp>{}; + +template <floating_point _Tp> inline constexpr _Tp e_v<_Tp> = 2.718281828459045235360287471352662L; +template <floating_point _Tp> inline constexpr _Tp log2e_v<_Tp> = 1.442695040888963407359924681001892L; +template <floating_point _Tp> inline constexpr _Tp log10e_v<_Tp> = 0.434294481903251827651128918916605L; +template <floating_point _Tp> inline constexpr _Tp pi_v<_Tp> = 3.141592653589793238462643383279502L; +template <floating_point _Tp> inline constexpr _Tp inv_pi_v<_Tp> = 0.318309886183790671537767526745028L; +template <floating_point _Tp> inline constexpr _Tp inv_sqrtpi_v<_Tp> = 0.564189583547756286948079451560772L; +template <floating_point _Tp> inline constexpr _Tp ln2_v<_Tp> = 0.693147180559945309417232121458176L; +template <floating_point _Tp> inline constexpr _Tp ln10_v<_Tp> = 2.302585092994045684017991454684364L; +template <floating_point _Tp> inline constexpr _Tp sqrt2_v<_Tp> = 1.414213562373095048801688724209698L; +template <floating_point _Tp> inline constexpr _Tp sqrt3_v<_Tp> = 1.732050807568877293527446341505872L; +template <floating_point _Tp> inline constexpr _Tp inv_sqrt3_v<_Tp> = 0.577350269189625764509148780501957L; +template <floating_point _Tp> inline constexpr _Tp egamma_v<_Tp> = 0.577215664901532860606512090082402L; +template <floating_point _Tp> inline constexpr _Tp phi_v<_Tp> = 1.618033988749894848204586834365638L; inline constexpr double e = e_v<double>; inline constexpr double log2e = log2e_v<double>; diff --git a/contrib/libs/cxxsupp/libcxx/include/optional b/contrib/libs/cxxsupp/libcxx/include/optional index 805e2e6d04..d016a97760 100644 --- a/contrib/libs/cxxsupp/libcxx/include/optional +++ b/contrib/libs/cxxsupp/libcxx/include/optional @@ -1162,8 +1162,8 @@ public: }; #if _LIBCPP_STD_VER >= 17 -template<class T> - optional(T) -> optional<T>; +template<class _Tp> + optional(_Tp) -> optional<_Tp>; #endif // Comparisons between optionals diff --git a/contrib/libs/cxxsupp/libcxx/include/regex b/contrib/libs/cxxsupp/libcxx/include/regex index 8203c81659..59b2c9a233 100644 --- a/contrib/libs/cxxsupp/libcxx/include/regex +++ b/contrib/libs/cxxsupp/libcxx/include/regex @@ -1310,19 +1310,51 @@ regex_traits<_CharT>::isctype(char_type __c, char_class_type __m) const return (__c == '_' && (__m & __regex_word)); } +inline _LIBCPP_INLINE_VISIBILITY +bool __is_07(unsigned char c) +{ + return (c & 0xF8u) == +#if defined(__MVS__) && !defined(__NATIVE_ASCII_F) + 0xF0; +#else + 0x30; +#endif +} + +inline _LIBCPP_INLINE_VISIBILITY +bool __is_89(unsigned char c) +{ + return (c & 0xFEu) == +#if defined(__MVS__) && !defined(__NATIVE_ASCII_F) + 0xF8; +#else + 0x38; +#endif +} + +inline _LIBCPP_INLINE_VISIBILITY +unsigned char __to_lower(unsigned char c) +{ +#if defined(__MVS__) && !defined(__NATIVE_ASCII_F) + return c & 0xBF; +#else + return c | 0x20; +#endif +} + template <class _CharT> int regex_traits<_CharT>::__regex_traits_value(unsigned char __ch, int __radix) { - if ((__ch & 0xF8u) == 0x30) // '0' <= __ch && __ch <= '7' + if (__is_07(__ch)) // '0' <= __ch && __ch <= '7' return __ch - '0'; if (__radix != 8) { - if ((__ch & 0xFEu) == 0x38) // '8' <= __ch && __ch <= '9' + if (__is_89(__ch)) // '8' <= __ch && __ch <= '9' return __ch - '0'; if (__radix == 16) { - __ch |= 0x20; // tolower + __ch = __to_lower(__ch); // tolower if ('a' <= __ch && __ch <= 'f') return __ch - ('a' - 10); } diff --git a/contrib/libs/cxxsupp/libcxx/include/semaphore b/contrib/libs/cxxsupp/libcxx/include/semaphore index f83f7b4551..7dffc94b13 100644 --- a/contrib/libs/cxxsupp/libcxx/include/semaphore +++ b/contrib/libs/cxxsupp/libcxx/include/semaphore @@ -47,6 +47,7 @@ using binary_semaphore = counting_semaphore<1>; #include <__availability> #include <__config> +#include <__thread/timed_backoff_policy.h> #include <__threading_support> #include <atomic> #include <version> diff --git a/contrib/libs/cxxsupp/libcxx/include/thread b/contrib/libs/cxxsupp/libcxx/include/thread index 00c4ae35ec..27756e42cd 100644 --- a/contrib/libs/cxxsupp/libcxx/include/thread +++ b/contrib/libs/cxxsupp/libcxx/include/thread @@ -87,6 +87,7 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time); #include <__functional_base> #include <__mutex_base> #include <__thread/poll_with_backoff.h> +#include <__thread/timed_backoff_policy.h> #include <__threading_support> #include <__utility/forward.h> #include <chrono> diff --git a/contrib/libs/cxxsupp/libcxx/include/tuple b/contrib/libs/cxxsupp/libcxx/include/tuple index 9480848dcf..b11d0d553c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/tuple +++ b/contrib/libs/cxxsupp/libcxx/include/tuple @@ -73,6 +73,19 @@ public: void swap(tuple&) noexcept(AND(swap(declval<T&>(), declval<T&>())...)); // constexpr in C++20 }; + +template<class... TTypes, class... UTypes, template<class> class TQual, template<class> class UQual> // since C++23 + requires requires { typename tuple<common_reference_t<TQual<TTypes>, UQual<UTypes>>...>; } +struct basic_common_reference<tuple<TTypes...>, tuple<UTypes...>, TQual, UQual> { + using type = tuple<common_reference_t<TQual<TTypes>, UQual<UTypes>>...>; +}; + +template<class... TTypes, class... UTypes> // since C++23 + requires requires { typename tuple<common_type_t<TTypes, UTypes>...>; } +struct common_type<tuple<TTypes...>, tuple<UTypes...>> { + using type = tuple<common_type_t<TTypes, UTypes>...>; +}; + template <class ...T> tuple(T...) -> tuple<T...>; // since C++17 template <class T1, class T2> @@ -1120,7 +1133,21 @@ public: void swap(tuple&) _NOEXCEPT {} }; -#if _LIBCPP_STD_VER >= 17 +#if _LIBCPP_STD_VER > 20 +template <class... _TTypes, class... _UTypes, template<class> class _TQual, template<class> class _UQual> + requires requires { typename tuple<common_reference_t<_TQual<_TTypes>, _UQual<_UTypes>>...>; } +struct basic_common_reference<tuple<_TTypes...>, tuple<_UTypes...>, _TQual, _UQual> { + using type = tuple<common_reference_t<_TQual<_TTypes>, _UQual<_UTypes>>...>; +}; + +template <class... _TTypes, class... _UTypes> + requires requires { typename tuple<common_type_t<_TTypes, _UTypes>...>; } +struct common_type<tuple<_TTypes...>, tuple<_UTypes...>> { + using type = tuple<common_type_t<_TTypes, _UTypes>...>; +}; +#endif + +#if _LIBCPP_STD_VER > 14 template <class ..._Tp> tuple(_Tp...) -> tuple<_Tp...>; template <class _Tp1, class _Tp2> diff --git a/contrib/libs/cxxsupp/libcxx/include/type_traits b/contrib/libs/cxxsupp/libcxx/include/type_traits index 170ed6a49b..02b814e1d6 100644 --- a/contrib/libs/cxxsupp/libcxx/include/type_traits +++ b/contrib/libs/cxxsupp/libcxx/include/type_traits @@ -2383,7 +2383,7 @@ struct __common_type_impl {}; // Clang provides variadic templates in C++03 as an extension. #if !defined(_LIBCPP_CXX03_LANG) || defined(__clang__) # define _LIBCPP_OPTIONAL_PACK(...) , __VA_ARGS__ -template <class... Tp> +template <class... _Tp> struct __common_types; template <class... _Tp> struct _LIBCPP_TEMPLATE_VIS common_type; diff --git a/contrib/libs/cxxsupp/libcxx/include/unordered_map b/contrib/libs/cxxsupp/libcxx/include/unordered_map index 3520fe2066..73edadab20 100644 --- a/contrib/libs/cxxsupp/libcxx/include/unordered_map +++ b/contrib/libs/cxxsupp/libcxx/include/unordered_map @@ -1186,13 +1186,10 @@ public: {return __table_.__insert_unique(__x);} iterator insert(const_iterator __p, const value_type& __x) { -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, - "unordered_map::insert(const_iterator, const value_type&) called with an iterator not" - " referring to this unordered_map"); -#else + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, + "unordered_map::insert(const_iterator, const value_type&) called with an iterator not " + "referring to this unordered_map"); ((void)__p); -#endif return insert(__x).first; } @@ -1210,13 +1207,10 @@ public: {return __table_.__insert_unique(_VSTD::move(__x));} iterator insert(const_iterator __p, value_type&& __x) { -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, - "unordered_map::insert(const_iterator, const value_type&) called with an iterator not" - " referring to this unordered_map"); -#else + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, + "unordered_map::insert(const_iterator, const value_type&) called with an iterator not" + " referring to this unordered_map"); ((void)__p); -#endif return __table_.__insert_unique(_VSTD::move(__x)).first; } @@ -1231,13 +1225,10 @@ public: _LIBCPP_INLINE_VISIBILITY iterator insert(const_iterator __p, _Pp&& __x) { -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, - "unordered_map::insert(const_iterator, value_type&&) called with an iterator not" - " referring to this unordered_map"); -#else + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, + "unordered_map::insert(const_iterator, value_type&&) called with an iterator not" + " referring to this unordered_map"); ((void)__p); -#endif return insert(_VSTD::forward<_Pp>(__x)).first; } @@ -1250,13 +1241,10 @@ public: template <class... _Args> _LIBCPP_INLINE_VISIBILITY iterator emplace_hint(const_iterator __p, _Args&&... __args) { -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, - "unordered_map::emplace_hint(const_iterator, args...) called with an iterator not" - " referring to this unordered_map"); -#else + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, + "unordered_map::emplace_hint(const_iterator, args...) called with an iterator not" + " referring to this unordered_map"); ((void)__p); -#endif return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...).first; } @@ -1285,13 +1273,10 @@ public: _LIBCPP_INLINE_VISIBILITY iterator try_emplace(const_iterator __h, const key_type& __k, _Args&&... __args) { -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__h) == this, - "unordered_map::try_emplace(const_iterator, key, args...) called with an iterator not" - " referring to this unordered_map"); -#else + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__h) == this, + "unordered_map::try_emplace(const_iterator, key, args...) called with an iterator not" + " referring to this unordered_map"); ((void)__h); -#endif return try_emplace(__k, _VSTD::forward<_Args>(__args)...).first; } @@ -1299,13 +1284,10 @@ public: _LIBCPP_INLINE_VISIBILITY iterator try_emplace(const_iterator __h, key_type&& __k, _Args&&... __args) { -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__h) == this, - "unordered_map::try_emplace(const_iterator, key, args...) called with an iterator not" - " referring to this unordered_map"); -#else + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(&__h) == this, + "unordered_map::try_emplace(const_iterator, key, args...) called with an iterator not" + " referring to this unordered_map"); ((void)__h); -#endif return try_emplace(_VSTD::move(__k), _VSTD::forward<_Args>(__args)...).first; } diff --git a/contrib/libs/cxxsupp/libcxx/include/vector b/contrib/libs/cxxsupp/libcxx/include/vector index 3d4d1eaff9..f8b286c127 100644 --- a/contrib/libs/cxxsupp/libcxx/include/vector +++ b/contrib/libs/cxxsupp/libcxx/include/vector @@ -1680,11 +1680,8 @@ inline _LIBCPP_INLINE_VISIBILITY typename vector<_Tp, _Allocator>::iterator vector<_Tp, _Allocator>::erase(const_iterator __position) { -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__position)) == this, - "vector::erase(iterator) called with an iterator not" - " referring to this vector"); -#endif + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__position)) == this, + "vector::erase(iterator) called with an iterator not referring to this vector"); _LIBCPP_ASSERT(__position != end(), "vector::erase(iterator) called with a non-dereferenceable iterator"); difference_type __ps = __position - cbegin(); @@ -1699,14 +1696,11 @@ template <class _Tp, class _Allocator> typename vector<_Tp, _Allocator>::iterator vector<_Tp, _Allocator>::erase(const_iterator __first, const_iterator __last) { -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__first)) == this, - "vector::erase(iterator, iterator) called with an iterator not" - " referring to this vector"); - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__last)) == this, - "vector::erase(iterator, iterator) called with an iterator not" - " referring to this vector"); -#endif + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__first)) == this, + "vector::erase(iterator, iterator) called with an iterator not referring to this vector"); + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__last)) == this, + "vector::erase(iterator, iterator) called with an iterator not referring to this vector"); + _LIBCPP_ASSERT(__first <= __last, "vector::erase(first, last) called with invalid range"); pointer __p = this->__begin_ + (__first - begin()); if (__first != __last) { @@ -1740,11 +1734,8 @@ template <class _Tp, class _Allocator> typename vector<_Tp, _Allocator>::iterator vector<_Tp, _Allocator>::insert(const_iterator __position, const_reference __x) { -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__position)) == this, - "vector::insert(iterator, x) called with an iterator not" - " referring to this vector"); -#endif + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__position)) == this, + "vector::insert(iterator, x) called with an iterator not referring to this vector"); pointer __p = this->__begin_ + (__position - begin()); if (this->__end_ < this->__end_cap()) { @@ -1777,11 +1768,8 @@ template <class _Tp, class _Allocator> typename vector<_Tp, _Allocator>::iterator vector<_Tp, _Allocator>::insert(const_iterator __position, value_type&& __x) { -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__position)) == this, - "vector::insert(iterator, x) called with an iterator not" - " referring to this vector"); -#endif + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__position)) == this, + "vector::insert(iterator, x) called with an iterator not referring to this vector"); pointer __p = this->__begin_ + (__position - begin()); if (this->__end_ < this->__end_cap()) { @@ -1810,11 +1798,8 @@ template <class... _Args> typename vector<_Tp, _Allocator>::iterator vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args) { -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__position)) == this, - "vector::emplace(iterator, x) called with an iterator not" - " referring to this vector"); -#endif + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__position)) == this, + "vector::emplace(iterator, x) called with an iterator not referring to this vector"); pointer __p = this->__begin_ + (__position - begin()); if (this->__end_ < this->__end_cap()) { @@ -1845,11 +1830,8 @@ template <class _Tp, class _Allocator> typename vector<_Tp, _Allocator>::iterator vector<_Tp, _Allocator>::insert(const_iterator __position, size_type __n, const_reference __x) { -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__position)) == this, - "vector::insert(iterator, n, x) called with an iterator not" - " referring to this vector"); -#endif + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__position)) == this, + "vector::insert(iterator, n, x) called with an iterator not referring to this vector"); pointer __p = this->__begin_ + (__position - begin()); if (__n > 0) { @@ -1896,11 +1878,8 @@ typename enable_if >::type vector<_Tp, _Allocator>::insert(const_iterator __position, _InputIterator __first, _InputIterator __last) { -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__position)) == this, - "vector::insert(iterator, range) called with an iterator not" - " referring to this vector"); -#endif + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__position)) == this, + "vector::insert(iterator, range) called with an iterator not referring to this vector"); difference_type __off = __position - begin(); pointer __p = this->__begin_ + __off; allocator_type& __a = this->__alloc(); @@ -1949,11 +1928,8 @@ typename enable_if >::type vector<_Tp, _Allocator>::insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last) { -#if _LIBCPP_DEBUG_LEVEL == 2 - _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__position)) == this, - "vector::insert(iterator, range) called with an iterator not" - " referring to this vector"); -#endif + _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__position)) == this, + "vector::insert(iterator, range) called with an iterator not referring to this vector"); pointer __p = this->__begin_ + (__position - begin()); difference_type __n = _VSTD::distance(__first, __last); if (__n > 0) diff --git a/contrib/libs/cxxsupp/libcxx/src/atomic.cpp b/contrib/libs/cxxsupp/libcxx/src/atomic.cpp index 9b61a16106..250d33e98b 100644 --- a/contrib/libs/cxxsupp/libcxx/src/atomic.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/atomic.cpp @@ -9,9 +9,10 @@ #include <__config> #ifndef _LIBCPP_HAS_NO_THREADS -#include <climits> #include <atomic> +#include <climits> #include <functional> +#include <thread> #ifdef __linux__ diff --git a/contrib/libs/cxxsupp/libcxx/src/locale.cpp b/contrib/libs/cxxsupp/libcxx/src/locale.cpp index 35dc4a831d..c9ecfb24ff 100644 --- a/contrib/libs/cxxsupp/libcxx/src/locale.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/locale.cpp @@ -892,7 +892,7 @@ ctype<wchar_t>::do_toupper(char_type c) const #ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE return isascii(c) ? _DefaultRuneLocale.__mapupper[c] : c; #elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) || \ - defined(__NetBSD__) + defined(__NetBSD__) || defined(__MVS__) return isascii(c) ? ctype<char>::__classic_upper_table()[c] : c; #else return (isascii(c) && iswlower_l(c, _LIBCPP_GET_C_LOCALE)) ? c-L'a'+L'A' : c; @@ -906,7 +906,7 @@ ctype<wchar_t>::do_toupper(char_type* low, const char_type* high) const #ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE *low = isascii(*low) ? _DefaultRuneLocale.__mapupper[*low] : *low; #elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) || \ - defined(__NetBSD__) + defined(__NetBSD__) || defined(__MVS__) *low = isascii(*low) ? ctype<char>::__classic_upper_table()[*low] : *low; #else @@ -921,7 +921,7 @@ ctype<wchar_t>::do_tolower(char_type c) const #ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE return isascii(c) ? _DefaultRuneLocale.__maplower[c] : c; #elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) || \ - defined(__NetBSD__) + defined(__NetBSD__) || defined(__MVS__) return isascii(c) ? ctype<char>::__classic_lower_table()[c] : c; #else return (isascii(c) && isupper_l(c, _LIBCPP_GET_C_LOCALE)) ? c-L'A'+'a' : c; @@ -935,7 +935,7 @@ ctype<wchar_t>::do_tolower(char_type* low, const char_type* high) const #ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE *low = isascii(*low) ? _DefaultRuneLocale.__maplower[*low] : *low; #elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) || \ - defined(__NetBSD__) + defined(__NetBSD__) || defined(__MVS__) *low = isascii(*low) ? ctype<char>::__classic_lower_table()[*low] : *low; #else @@ -1007,7 +1007,7 @@ ctype<char>::do_toupper(char_type c) const static_cast<char>(_DefaultRuneLocale.__mapupper[static_cast<ptrdiff_t>(c)]) : c; #elif defined(__NetBSD__) return static_cast<char>(__classic_upper_table()[static_cast<unsigned char>(c)]); -#elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) +#elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) || defined(__MVS__) return isascii(c) ? static_cast<char>(__classic_upper_table()[static_cast<unsigned char>(c)]) : c; #else @@ -1024,7 +1024,7 @@ ctype<char>::do_toupper(char_type* low, const char_type* high) const static_cast<char>(_DefaultRuneLocale.__mapupper[static_cast<ptrdiff_t>(*low)]) : *low; #elif defined(__NetBSD__) *low = static_cast<char>(__classic_upper_table()[static_cast<unsigned char>(*low)]); -#elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) +#elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) || defined(__MVS__) *low = isascii(*low) ? static_cast<char>(__classic_upper_table()[static_cast<size_t>(*low)]) : *low; #else @@ -1041,7 +1041,7 @@ ctype<char>::do_tolower(char_type c) const static_cast<char>(_DefaultRuneLocale.__maplower[static_cast<ptrdiff_t>(c)]) : c; #elif defined(__NetBSD__) return static_cast<char>(__classic_lower_table()[static_cast<unsigned char>(c)]); -#elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) +#elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) || defined(__MVS__) return isascii(c) ? static_cast<char>(__classic_lower_table()[static_cast<size_t>(c)]) : c; #else @@ -1057,7 +1057,7 @@ ctype<char>::do_tolower(char_type* low, const char_type* high) const *low = isascii(*low) ? static_cast<char>(_DefaultRuneLocale.__maplower[static_cast<ptrdiff_t>(*low)]) : *low; #elif defined(__NetBSD__) *low = static_cast<char>(__classic_lower_table()[static_cast<unsigned char>(*low)]); -#elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) +#elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) || defined(__MVS__) *low = isascii(*low) ? static_cast<char>(__classic_lower_table()[static_cast<size_t>(*low)]) : *low; #else *low = (isascii(*low) && isupper_l(*low, _LIBCPP_GET_C_LOCALE)) ? *low-'A'+'a' : *low; @@ -1212,6 +1212,12 @@ ctype<char>::classic_table() noexcept return _ctype_android; #elif defined(_AIX) return (const unsigned int *)__lc_ctype_ptr->obj->mask; +#elif defined(__MVS__) +# if defined(__NATIVE_ASCII_F) + return const_cast<const ctype<char>::mask*> (__OBJ_DATA(__lc_ctype_a)->mask); +# else + return const_cast<const ctype<char>::mask*> (__ctypec); +# endif #else // Platform not supported: abort so the person doing the port knows what to // fix @@ -1260,7 +1266,26 @@ ctype<char>::__classic_upper_table() noexcept { return *__ctype_toupper_loc(); } -#endif // __GLIBC__ || __NETBSD__ || __EMSCRIPTEN__ +#elif defined(__MVS__) +const unsigned short* +ctype<char>::__classic_lower_table() _NOEXCEPT +{ +# if defined(__NATIVE_ASCII_F) + return const_cast<const unsigned short*>(__OBJ_DATA(__lc_ctype_a)->lower); +# else + return const_cast<const unsigned short*>(__ctype + __TOLOWER_INDEX); +# endif +} +const unsigned short * +ctype<char>::__classic_upper_table() _NOEXCEPT +{ +# if defined(__NATIVE_ASCII_F) + return const_cast<const unsigned short*>(__OBJ_DATA(__lc_ctype_a)->upper); +# else + return const_cast<const unsigned short*>(__ctype + __TOUPPER_INDEX); +# endif +} +#endif // __GLIBC__ || __NETBSD__ || __EMSCRIPTEN__ || __MVS__ // template <> class ctype_byname<char> diff --git a/contrib/libs/cxxsupp/libcxx/src/regex.cpp b/contrib/libs/cxxsupp/libcxx/src/regex.cpp index 425339a5c9..16ad8f0eff 100644 --- a/contrib/libs/cxxsupp/libcxx/src/regex.cpp +++ b/contrib/libs/cxxsupp/libcxx/src/regex.cpp @@ -76,6 +76,125 @@ struct collationnames char char_; }; +#if defined(__MVS__) && !defined(__NATIVE_ASCII_F) +// EBCDIC IBM-1047 +// Sorted via the EBCDIC collating sequence +const collationnames collatenames[] = +{ + {"a", 0x81}, + {"alert", 0x2f}, + {"ampersand", 0x50}, + {"apostrophe", 0x7d}, + {"asterisk", 0x5c}, + {"b", 0x82}, + {"backslash", 0xe0}, + {"backspace", 0x16}, + {"c", 0x83}, + {"carriage-return", 0xd}, + {"circumflex", 0x5f}, + {"circumflex-accent", 0x5f}, + {"colon", 0x7a}, + {"comma", 0x6b}, + {"commercial-at", 0x7c}, + {"d", 0x84}, + {"dollar-sign", 0x5b}, + {"e", 0x85}, + {"eight", 0xf8}, + {"equals-sign", 0x7e}, + {"exclamation-mark", 0x5a}, + {"f", 0x86}, + {"five", 0xf5}, + {"form-feed", 0xc}, + {"four", 0xf4}, + {"full-stop", 0x4b}, + {"g", 0x87}, + {"grave-accent", 0x79}, + {"greater-than-sign", 0x6e}, + {"h", 0x88}, + {"hyphen", 0x60}, + {"hyphen-minus", 0x60}, + {"i", 0x89}, + {"j", 0x91}, + {"k", 0x92}, + {"l", 0x93}, + {"left-brace", 0xc0}, + {"left-curly-bracket", 0xc0}, + {"left-parenthesis", 0x4d}, + {"left-square-bracket", 0xad}, + {"less-than-sign", 0x4c}, + {"low-line", 0x6d}, + {"m", 0x94}, + {"n", 0x95}, + {"newline", 0x15}, + {"nine", 0xf9}, + {"number-sign", 0x7b}, + {"o", 0x96}, + {"one", 0xf1}, + {"p", 0x97}, + {"percent-sign", 0x6c}, + {"period", 0x4b}, + {"plus-sign", 0x4e}, + {"q", 0x98}, + {"question-mark", 0x6f}, + {"quotation-mark", 0x7f}, + {"r", 0x99}, + {"reverse-solidus", 0xe0}, + {"right-brace", 0xd0}, + {"right-curly-bracket", 0xd0}, + {"right-parenthesis", 0x5d}, + {"right-square-bracket", 0xbd}, + {"s", 0xa2}, + {"semicolon", 0x5e}, + {"seven", 0xf7}, + {"six", 0xf6}, + {"slash", 0x61}, + {"solidus", 0x61}, + {"space", 0x40}, + {"t", 0xa3}, + {"tab", 0x5}, + {"three", 0xf3}, + {"tilde", 0xa1}, + {"two", 0xf2}, + {"u", 0xa4}, + {"underscore", 0x6d}, + {"v", 0xa5}, + {"vertical-line", 0x4f}, + {"vertical-tab", 0xb}, + {"w", 0xa6}, + {"x", 0xa7}, + {"y", 0xa8}, + {"z", 0xa9}, + {"zero", 0xf0}, + {"A", 0xc1}, + {"B", 0xc2}, + {"C", 0xc3}, + {"D", 0xc4}, + {"E", 0xc5}, + {"F", 0xc6}, + {"G", 0xc7}, + {"H", 0xc8}, + {"I", 0xc9}, + {"J", 0xd1}, + {"K", 0xd2}, + {"L", 0xd3}, + {"M", 0xd4}, + {"N", 0xd5}, + {"NUL", 0}, + {"O", 0xd6}, + {"P", 0xd7}, + {"Q", 0xd8}, + {"R", 0xd9}, + {"S", 0xe2}, + {"T", 0xe3}, + {"U", 0xe4}, + {"V", 0xe5}, + {"W", 0xe6}, + {"X", 0xe7}, + {"Y", 0xe8}, + {"Z", 0xe9} +}; +#else +// ASCII const collationnames collatenames[] = { {"A", 0x41}, @@ -190,6 +309,7 @@ const collationnames collatenames[] = {"z", 0x7a}, {"zero", 0x30} }; +#endif struct classnames { |