diff --git a/lib/libcxx/include/__config b/lib/libcxx/include/__config index de32af8f760e0f88f74b7ffa7554be2b7a9ae7f9..cc7a377334a83cbb34b8a997151b7e76b3810a9c 100644 --- a/lib/libcxx/include/__config +++ b/lib/libcxx/include/__config @@ -30,7 +30,7 @@ // _LIBCPP_VERSION represents the version of libc++, which matches the version of LLVM. // Given a LLVM release LLVM XX.YY.ZZ (e.g. LLVM 17.0.1 == 17.00.01), _LIBCPP_VERSION is // defined to XXYYZZ. -# define _LIBCPP_VERSION 220104 +# define _LIBCPP_VERSION 220108 # define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y # define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y) diff --git a/lib/libcxx/include/__tree b/lib/libcxx/include/__tree index eb17f7d36936c819a89586da357c4957b57cb317..ddeb82f91b8ad587c15fa7d2af8b3bd3784379f8 100644 --- a/lib/libcxx/include/__tree +++ b/lib/libcxx/include/__tree @@ -2026,8 +2026,8 @@ __tree<_Tp, _Compare, _Allocator>::__node_handle_insert_unique(const_iterator __ template template _LIBCPP_HIDE_FROM_ABI _NodeHandle __tree<_Tp, _Compare, _Allocator>::__node_handle_extract(key_type const& __key) { - iterator __it = find(__key); - if (__it == end()) + iterator __it = __lower_bound_multi(__key); + if (__it == end() || __value_comp_(__key, *__it)) return _NodeHandle(); return __node_handle_extract<_NodeHandle>(__it); } diff --git a/lib/libcxx/include/optional b/lib/libcxx/include/optional index 12fbcdfa5c5d605ca01f0dedc64a0fc931b75176..4d85ac1e0ff5e800f9adf1e6aa8059b015e55713 100644 --- a/lib/libcxx/include/optional +++ b/lib/libcxx/include/optional @@ -828,6 +828,10 @@ private: template constexpr static bool __libcpp_opt_ref_ctor_deleted = is_lvalue_reference_v<_Tp> && reference_constructs_from_temporary_v<_Tp, _Up>; + + template + constexpr static bool __ref_ctor_enabled = + is_lvalue_reference_v<_Tp> && !reference_constructs_from_temporary_v<_Tp, _Up>; # endif // LWG2756: conditionally explicit conversion from _Up @@ -935,7 +939,7 @@ public: template ::template __enable_implicit<_Up>(), int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 optional(const optional<_Up>& __v) # if _LIBCPP_STD_VER >= 26 - noexcept(is_lvalue_reference_v<_Tp> && is_nothrow_constructible_v<_Tp&, _Up&>) + noexcept(is_lvalue_reference_v<_Tp> && is_nothrow_constructible_v<_Tp&, const _Up&>) # endif { this->__construct_from(__v); @@ -943,7 +947,7 @@ public: template ::template __enable_explicit<_Up>(), int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit optional(const optional<_Up>& __v) # if _LIBCPP_STD_VER >= 26 - noexcept(is_lvalue_reference_v<_Tp> && is_nothrow_constructible_v<_Tp&, _Up&>) + noexcept(is_lvalue_reference_v<_Tp> && is_nothrow_constructible_v<_Tp&, const _Up&>) # endif { this->__construct_from(__v); @@ -981,25 +985,25 @@ public: // optional(optional& rhs) template - requires(!__libcpp_opt_ref_ctor_deleted<_Up>) && (!is_same_v, optional<_Up>>) && - (!is_same_v<_Tp&, _Up>) && is_constructible_v<_Tp&, _Up&> + requires __ref_ctor_enabled<_Up&> && (!is_same_v, optional<_Up>>) && (!is_same_v<_Tp&, _Up>) && + is_constructible_v<_Tp&, _Up&> _LIBCPP_HIDE_FROM_ABI constexpr explicit(!is_convertible_v<_Up&, _Tp&>) optional(optional<_Up>& __rhs) noexcept(is_nothrow_constructible_v<_Tp&, _Up&>) { this->__construct_from(__rhs); } template - requires __libcpp_opt_ref_ctor_deleted<_Up> && (!is_same_v, optional<_Up>>) && + requires __libcpp_opt_ref_ctor_deleted<_Up&> && (!is_same_v, optional<_Up>>) && (!is_same_v<_Tp&, _Up>) && is_constructible_v<_Tp&, _Up&> constexpr explicit optional(optional<_Up>& __rhs) noexcept = delete; // optional(const optional&) template ::template __enable_implicit<_Up>(), int> = 0> - requires __libcpp_opt_ref_ctor_deleted<_Up> + requires __libcpp_opt_ref_ctor_deleted optional(const optional<_Up>&) = delete; template ::template __enable_explicit<_Up>(), int> = 0> - requires __libcpp_opt_ref_ctor_deleted<_Up> + requires __libcpp_opt_ref_ctor_deleted explicit optional(const optional<_Up>&) = delete; // optional(optional&&) @@ -1013,16 +1017,16 @@ public: // optional(const optional&&) template - requires(!__libcpp_opt_ref_ctor_deleted<_Up>) && (!is_same_v, optional<_Up>>) && - (!is_same_v<_Tp&, _Up>) && is_constructible_v<_Tp&, _Up> + requires __ref_ctor_enabled && (!is_same_v, optional<_Up>>) && + (!is_same_v<_Tp&, _Up>) && is_constructible_v<_Tp&, const _Up> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit(!is_convertible_v) optional(const optional<_Up>&& __v) noexcept(is_nothrow_constructible_v<_Tp&, const _Up>) { this->__construct_from(std::move(__v)); } template - requires __libcpp_opt_ref_ctor_deleted<_Up> && (!is_same_v, optional<_Up>>) && - (!is_same_v<_Tp&, _Up>) && is_constructible_v<_Tp&, _Up> + requires __libcpp_opt_ref_ctor_deleted && (!is_same_v, optional<_Up>>) && + (!is_same_v<_Tp&, _Up>) && is_constructible_v<_Tp&, const _Up> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 optional(const optional<_Up>&& __v) noexcept = delete; # endif