gcc/libstdc++-v3/testsuite/20_util/tuple
Osama Abdelkader 52e300124d libstdc++: Add constructors and assignments for tuple<> with tuple-like types [PR119721]
This patch adds support for constructing and assigning tuple<> from
other empty tuple-like types (e.g., array<T, 0>), completing the C++23
tuple-like interface for the zero-element tuple specialization.

The implementation includes:
- Constructor from forwarding reference to tuple-like types
- Allocator-aware constructor from tuple-like types
- Assignment operator from tuple-like types
- Const assignment operator from tuple-like types

	PR libstdc++/119721

libstdc++-v3/ChangeLog:

	* include/std/tuple (tuple<>::tuple(const tuple&))
	(tuple<>::operator=(const tuple&)): Define as defaulted.
	(tuple<>::swap): Moved the defintion after assignments.
	(tuple<>::tuple(_UTuple&&))
	(tuple<>::tuple(allocator_arg_t, const _Alloc&, _UTuple&&))
	(tuple<>::operator=(_UTuple&&)) [__cpp_lib_tuple_like]: Define.
	(tuple<>::operator==, tuple<>::opeator<=>): Parenthesize
	constrains individually.
	* testsuite/23_containers/tuple/cons/119721.cc: New test for
	constructors and assignments with empty tuple-like types.
	* testsuite/20_util/tuple/requirements/empty_trivial.cc:
	New test verifying tuple<> remains trivially copyable.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Co-authored-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
2025-10-29 17:09:15 +01:00
..
apply Update copyright years. 2025-01-02 11:59:57 +01:00
comparison_operators libstdc++: Make operator== for std::tuple convert to bool [PR119545] 2025-03-31 17:12:26 +01:00
cons Update copyright years. 2025-01-02 11:59:57 +01:00
creation_functions Update copyright years. 2025-01-02 11:59:57 +01:00
element_access c++: improve pack index diagnostics 2025-04-17 13:19:42 -04:00
make_from_tuple Update copyright years. 2025-01-02 11:59:57 +01:00
requirements libstdc++: Add constructors and assignments for tuple<> with tuple-like types [PR119721] 2025-10-29 17:09:15 +01:00
48476.cc Update copyright years. 2025-01-02 11:59:57 +01:00
51365.cc Update copyright years. 2025-01-02 11:59:57 +01:00
53648.cc Update copyright years. 2025-01-02 11:59:57 +01:00
56785.cc Update copyright years. 2025-01-02 11:59:57 +01:00
60497.cc Update copyright years. 2025-01-02 11:59:57 +01:00
61947.cc Update copyright years. 2025-01-02 11:59:57 +01:00
67844.cc Update copyright years. 2025-01-02 11:59:57 +01:00
77395.cc Update copyright years. 2025-01-02 11:59:57 +01:00
77802.cc Update copyright years. 2025-01-02 11:59:57 +01:00
78939.cc Update copyright years. 2025-01-02 11:59:57 +01:00
116440.C libstdc++: Work around C++20 tuple<tuple<any>> constraint recursion [PR116440] 2025-03-13 19:55:00 -04:00
constexpr_swap.cc Update copyright years. 2025-01-02 11:59:57 +01:00
cv_tuple_element.cc Update copyright years. 2025-01-02 11:59:57 +01:00
cv_tuple_size.cc Update copyright years. 2025-01-02 11:59:57 +01:00
cv_tuple_size_neg.cc Update copyright years. 2025-01-02 11:59:57 +01:00
dangling_ref.cc libstdc++: Fix some Parallel Mode testsuite failures 2024-10-04 14:08:28 +01:00
dr2729.cc Update copyright years. 2025-01-02 11:59:57 +01:00
dr3528.cc libstdc++: Implement LWG3528 make_from_tuple can perform (the equivalent of) a C-style cast 2025-06-10 14:28:55 +01:00
moveable.cc Update copyright years. 2025-01-02 11:59:57 +01:00
moveable2.cc Update copyright years. 2025-01-02 11:59:57 +01:00
noexcept_move_assign.cc Update copyright years. 2025-01-02 11:59:57 +01:00
noexcept_swap.cc Update copyright years. 2025-01-02 11:59:57 +01:00
p2165r4.cc libstdc++: Implement P2165R4 changes to std::pair/tuple/etc [PR113309] 2024-02-01 14:59:46 -05:00
p2321r2.cc libstdc++: Test for feature test macros more accurately 2023-11-16 08:06:59 +00:00
swap.cc Update copyright years. 2025-01-02 11:59:57 +01:00
swap_cxx17.cc Update copyright years. 2025-01-02 11:59:57 +01:00
tuple_element.cc Update copyright years. 2025-01-02 11:59:57 +01:00
tuple_element_t.cc Update copyright years. 2025-01-02 11:59:57 +01:00
tuple_like_ftm.cc libstdc++: implement tuple protocol for std::complex (P2819R2) 2025-03-06 12:24:47 +01:00
tuple_size.cc Update copyright years. 2025-01-02 11:59:57 +01:00
tuple_size_v.cc Update copyright years. 2025-01-02 11:59:57 +01:00