Skip to content

Commit 4e73566

Browse files
committed
Guard with _LIBCPP_STD_VER >= 23 and update test
Signed-off-by: yronglin <[email protected]>
1 parent 59baea1 commit 4e73566

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

libcxx/include/tuple

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,10 +1456,12 @@ 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
14591460
if constexpr (tuple_size_v<remove_reference_t<_Tuple>> == 1) {
14601461
static_assert(!__reference_constructs_from_temporary_v<_Tp, decltype(std::get<0>(std::declval<_Tuple>()))>,
14611462
"Attempted construction of reference element binds to a temporary whose lifetime has ended");
14621463
}
1464+
#endif // _LIBCPP_STD_VER >= 23
14631465
return std::__make_from_tuple_impl<_Tp>(
14641466
std::forward<_Tuple>(__t), make_index_sequence<tuple_size_v<remove_reference_t<_Tuple>>>());
14651467
}

libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.verify.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// REQUIRES: std-at-least-c++17
9+
// REQUIRES: std-at-least-c++23
1010

1111
// No diagnostic gets emitted when we build with modules.
12-
// XFAIL: (c++17 && clang-modules-build)
12+
// XFAIL: clang-modules-build
1313

1414
// <tuple>
1515

0 commit comments

Comments
 (0)