[libcxx-commits] [libcxx] [libc++][tuple.apply] Implement P2255R2 make_from_tuple part. (PR #152867)
via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Aug 14 19:50:55 PDT 2025
================
@@ -1451,10 +1452,19 @@ template <class _Tp, class _Tuple>
#else
template <class _Tp, class _Tuple, class = enable_if_t<__can_make_from_tuple<_Tp, _Tuple>>> // strengthen
#endif // _LIBCPP_STD_VER >= 20
+
inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp make_from_tuple(_Tuple&& __t)
- _LIBCPP_NOEXCEPT_RETURN(std::__make_from_tuple_impl<_Tp>(
- std::forward<_Tuple>(__t), make_index_sequence<tuple_size_v<remove_reference_t<_Tuple>>>()))
-# undef _LIBCPP_NOEXCEPT_RETURN
+ noexcept(noexcept(std::__make_from_tuple_impl<_Tp>(std::forward<_Tuple>(__t),
+ make_index_sequence<tuple_size_v<remove_reference_t<_Tuple>>>()))) {
+#if _LIBCPP_STD_VER >= 23 && __has_builtin(__reference_constructs_from_temporary)
+ if constexpr (tuple_size_v<remove_reference_t<_Tuple>> == 1) {
+ static_assert(!__reference_constructs_from_temporary_v<_Tp, decltype(std::get<0>(std::declval<_Tuple>()))>,
----------------
yronglin wrote:
Fixed
https://github.com/llvm/llvm-project/pull/152867
More information about the libcxx-commits
mailing list