diff --git a/libcxx/include/optional b/libcxx/include/optional index 12fbcdfa5c5d6..3335bd9fbd53a 100644 --- a/libcxx/include/optional +++ b/libcxx/include/optional @@ -688,6 +688,7 @@ struct __is_std_optional> : true_type {}; template inline constexpr bool __is_constructible_for_optional_v = is_constructible_v<_Tp, _Args...>; +// TODO(LLVM 23): Remove this workaround. template struct __is_constructible_for_optional : bool_constant<__is_constructible_for_optional_v<_Tp, _Args...>> {}; @@ -901,11 +902,9 @@ public: _LIBCPP_HIDE_FROM_ABI constexpr optional(optional&&) = default; _LIBCPP_HIDE_FROM_ABI constexpr optional(nullopt_t) noexcept {} - template < - class _InPlaceT, - class... _Args, - enable_if_t<_And<_IsSame<_InPlaceT, in_place_t>, __is_constructible_for_optional<_Tp, _Args...>>::value, int> = 0> - _LIBCPP_HIDE_FROM_ABI constexpr explicit optional(_InPlaceT, _Args&&... __args) + // TODO(LLVM 23): Use _v instead of ::value. + template ::value, int> = 0> + _LIBCPP_HIDE_FROM_ABI constexpr explicit optional(in_place_t, _Args&&... __args) : __base(in_place, std::forward<_Args>(__args)...) {} template , int> = 0> + // TODO(LLVM 23): Use _v instead of ::value. + template ::value, int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& emplace(_Args&&... __args) # if _LIBCPP_STD_VER >= 26 noexcept(is_lvalue_reference_v<_Tp> && is_nothrow_constructible_v<_Tp, _Args...>)