aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxxmsvc/.yandex_meta/patches/43-string.patch
diff options
context:
space:
mode:
authormaxim-yurchuk <maxim-yurchuk@yandex-team.com>2024-10-09 12:29:46 +0300
committermaxim-yurchuk <maxim-yurchuk@yandex-team.com>2024-10-09 13:14:22 +0300
commit9731d8a4bb7ee2cc8554eaf133bb85498a4c7d80 (patch)
treea8fb3181d5947c0d78cf402aa56e686130179049 /contrib/libs/cxxsupp/libcxxmsvc/.yandex_meta/patches/43-string.patch
parenta44b779cd359f06c3ebbef4ec98c6b38609d9d85 (diff)
downloadydb-9731d8a4bb7ee2cc8554eaf133bb85498a4c7d80.tar.gz
publishFullContrib: true for ydb
<HIDDEN_URL> commit_hash:c82a80ac4594723cebf2c7387dec9c60217f603e
Diffstat (limited to 'contrib/libs/cxxsupp/libcxxmsvc/.yandex_meta/patches/43-string.patch')
-rw-r--r--contrib/libs/cxxsupp/libcxxmsvc/.yandex_meta/patches/43-string.patch134
1 files changed, 134 insertions, 0 deletions
diff --git a/contrib/libs/cxxsupp/libcxxmsvc/.yandex_meta/patches/43-string.patch b/contrib/libs/cxxsupp/libcxxmsvc/.yandex_meta/patches/43-string.patch
new file mode 100644
index 0000000000..ffbff2794c
--- /dev/null
+++ b/contrib/libs/cxxsupp/libcxxmsvc/.yandex_meta/patches/43-string.patch
@@ -0,0 +1,134 @@
+diff --git a/include/string b/include/string
+index 53cf9ab..a1bfff1 100644
+--- a/include/string
++++ b/include/string
+@@ -652,6 +652,7 @@ class
+ #endif
+ basic_string
+ {
++ static_assert(sizeof(_CharT) <= 4, "libc++ implementation of std::basic_string does not support extra-wide character types");
+ public:
+ typedef basic_string __self;
+ typedef basic_string_view<_CharT, _Traits> __self_view;
+@@ -674,8 +675,13 @@ public:
+ static_assert(( is_same<typename allocator_type::value_type, value_type>::value),
+ "Allocator::value_type must be same type as value_type");
+
++#if _YNDX_LIBCPP_MAKE_STRING_ITERATOR_POINTERS == 1
++ typedef pointer iterator;
++ typedef const_pointer const_iterator;
++#else
+ typedef __wrap_iter<pointer> iterator;
+ typedef __wrap_iter<const_pointer> const_iterator;
++#endif
+ typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
+ typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
+
+@@ -790,6 +796,10 @@ public:
+ _NOEXCEPT;
+ #endif
+
++#if _LIBCPP_STD_VER > 17
++ basic_string(nullptr_t) = delete;
++#endif
++
+ _LIBCPP_INLINE_VISIBILITY
+ basic_string(basic_string&& __str, const allocator_type& __a);
+ #endif // _LIBCPP_CXX03_LANG
+@@ -806,14 +816,18 @@ public:
+ _LIBCPP_INLINE_VISIBILITY
+ basic_string(const _CharT* __s, const _Allocator& __a);
+
+-#if _LIBCPP_STD_VER > 20
+- basic_string(nullptr_t) = delete;
+-#endif
++ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
++ basic_string(nullptr_t, size_t) = delete;
+
+ _LIBCPP_INLINE_VISIBILITY
+ basic_string(const _CharT* __s, size_type __n);
++
++ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
++ basic_string(nullptr_t, size_t, const _Allocator&) = delete;
++
+ _LIBCPP_INLINE_VISIBILITY
+ basic_string(const _CharT* __s, size_type __n, const _Allocator& __a);
++
+ _LIBCPP_INLINE_VISIBILITY
+ basic_string(size_type __n, _CharT __c);
+
+@@ -861,6 +875,8 @@ public:
+
+ basic_string& operator=(const basic_string& __str);
+
++ basic_string& operator=(nullptr_t) = delete;
++
+ template <class _Tp, class = __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string>::value> >
+ basic_string& operator=(const _Tp& __t)
+ {__self_view __sv = __t; return assign(__sv);}
+@@ -939,6 +955,14 @@ public:
+ {return (__is_long() ? __get_long_cap()
+ : static_cast<size_type>(__min_cap)) - 1;}
+
++
++#if _YNDX_LIBCXX_ENABLE_STRING_RESIZE_UNINITIALIZED == 1
++ inline void resize_uninitialized(size_type __n)
++ {
++ __resize_default_init(__n);
++ }
++#endif
++
+ void resize(size_type __n, value_type __c);
+ _LIBCPP_INLINE_VISIBILITY void resize(size_type __n) {resize(__n, value_type());}
+
+@@ -1375,7 +1399,8 @@ public:
+ int compare(size_type __pos1, size_type __n1, const value_type* __s) const;
+ int compare(size_type __pos1, size_type __n1, const value_type* __s, size_type __n2) const;
+
+-#if _LIBCPP_STD_VER > 17
++//WARN: disabled std guards in order to allow using these options without switching to new std
++//#if _LIBCPP_STD_VER > 17
+ constexpr _LIBCPP_INLINE_VISIBILITY
+ bool starts_with(__self_view __sv) const noexcept
+ { return __self_view(data(), size()).starts_with(__sv); }
+@@ -1399,9 +1424,9 @@ public:
+ constexpr _LIBCPP_INLINE_VISIBILITY
+ bool ends_with(const value_type* __s) const noexcept
+ { return ends_with(__self_view(__s)); }
+-#endif
++//#endif
+
+-#if _LIBCPP_STD_VER > 20
++#if _LIBCPP_STD_VER >= 20
+ constexpr _LIBCPP_INLINE_VISIBILITY
+ bool contains(__self_view __sv) const noexcept
+ { return __self_view(data(), size()).contains(__sv); }
+@@ -2316,7 +2341,7 @@ basic_string<_CharT, _Traits, _Allocator>&
+ basic_string<_CharT, _Traits, _Allocator>::assign(const value_type* __s, size_type __n)
+ {
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::assign received nullptr");
+- return (__builtin_constant_p(__n) && __fits_in_sso(__n))
++ return (_LIBCPP_BUILTIN_CONSTANT_P(__n) && __fits_in_sso(__n))
+ ? __assign_short(__s, __n)
+ : __assign_external(__s, __n);
+ }
+@@ -2518,7 +2543,7 @@ basic_string<_CharT, _Traits, _Allocator>&
+ basic_string<_CharT, _Traits, _Allocator>::assign(const value_type* __s)
+ {
+ _LIBCPP_ASSERT(__s != nullptr, "string::assign received nullptr");
+- return __builtin_constant_p(*__s)
++ return _LIBCPP_BUILTIN_CONSTANT_P(*__s)
+ ? (__fits_in_sso(traits_type::length(__s))
+ ? __assign_short(__s, traits_type::length(__s))
+ : __assign_external(__s, traits_type::length(__s)))
+@@ -4494,6 +4519,10 @@ inline namespace literals
+
+ _LIBCPP_END_NAMESPACE_STD
+
++#ifdef _LIBCPP_COMPILER_MSVC
++#pragma warning ( pop )
++#endif
++
+ _LIBCPP_POP_MACROS
+
+ #endif // _LIBCPP_STRING