@@ -2254,7 +2254,6 @@ private:
22542254 return __guess;
22552255 }
22562256
2257- inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void __init (const value_type* __s, size_type __sz, size_type __reserve);
22582257 inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void __init (const value_type* __s, size_type __sz);
22592258 inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void __init (size_type __n, value_type __c);
22602259
@@ -2439,6 +2438,12 @@ private:
24392438 template <class _CharT2 , class _Traits2 , class _Allocator2 >
24402439 friend inline _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool
24412440 operator ==(const basic_string<_CharT2, _Traits2, _Allocator2>&, const _CharT2*) _NOEXCEPT;
2441+
2442+ // These functions aren't used anymore but are part of out ABI, so we need to provide them in the dylib for backwards
2443+ // compatibility
2444+ # ifdef _LIBCPP_BUILDING_LIBRARY
2445+ void __init (const value_type* __s, size_type __sz, size_type __reserve);
2446+ # endif
24422447};
24432448
24442449// These declarations must appear before any functions are implicitly used
@@ -2490,30 +2495,6 @@ basic_string(from_range_t, _Range&&, _Allocator = _Allocator())
24902495 -> basic_string<ranges::range_value_t<_Range>, char_traits<ranges::range_value_t<_Range>>, _Allocator>;
24912496# endif
24922497
2493- template <class _CharT , class _Traits , class _Allocator >
2494- _LIBCPP_CONSTEXPR_SINCE_CXX20 void
2495- basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_type __sz, size_type __reserve) {
2496- if (__libcpp_is_constant_evaluated ())
2497- __rep_ = __rep ();
2498- if (__reserve > max_size ())
2499- __throw_length_error ();
2500- pointer __p;
2501- if (__fits_in_sso (__reserve)) {
2502- __set_short_size (__sz);
2503- __p = __get_short_pointer ();
2504- } else {
2505- auto __allocation = std::__allocate_at_least (__alloc_, __recommend (__reserve) + 1 );
2506- __p = __allocation.ptr ;
2507- __begin_lifetime (__p, __allocation.count );
2508- __set_long_pointer (__p);
2509- __set_long_cap (__allocation.count );
2510- __set_long_size (__sz);
2511- }
2512- traits_type::copy (std::__to_address (__p), __s, __sz);
2513- traits_type::assign (__p[__sz], value_type ());
2514- __annotate_new (__sz);
2515- }
2516-
25172498template <class _CharT , class _Traits , class _Allocator >
25182499_LIBCPP_CONSTEXPR_SINCE_CXX20 void
25192500basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_type __sz) {
0 commit comments