Skip to content

Commit 65472f9

Browse files
committed
Check compiler implemented __reference_constructs_from_temporary
Signed-off-by: yronglin <[email protected]>
1 parent 3caf149 commit 65472f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libcxx/include/tuple

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1456,7 +1456,7 @@ template <class _Tp, class _Tuple, class = enable_if_t<__can_make_from_tuple<_Tp
14561456
inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp make_from_tuple(_Tuple&& __t)
14571457
noexcept(noexcept(std::__make_from_tuple_impl<_Tp>(std::forward<_Tuple>(__t),
14581458
make_index_sequence<tuple_size_v<remove_reference_t<_Tuple>>>()))) {
1459-
#if _LIBCPP_STD_VER >= 23
1459+
#if _LIBCPP_STD_VER >= 23 && __has_builtin(__reference_constructs_from_temporary)
14601460
if constexpr (tuple_size_v<remove_reference_t<_Tuple>> == 1) {
14611461
static_assert(!__reference_constructs_from_temporary_v<_Tp, decltype(std::get<0>(std::declval<_Tuple>()))>,
14621462
"Attempted construction of reference element binds to a temporary whose lifetime has ended");

0 commit comments

Comments
 (0)