gcc/libstdc++-v3/include
Jonathan Wakely ac28c9730c
libstdc++: Make CTAD ignore pair(const T1&, const T2&) constructor [PR110853]
For the pair(T1, T2) explicit deduction type to decay its arguments as
intended, we need the pair(const T1&, const T2&) constructor to not be
used for CTAD. Otherwise we try to instantiate pair<T1, T2> without
decaying, which is ill-formed for function lvalues.

Use std::type_identity_t<T1> to make the constructor unusable for an
implicit deduction guide.

libstdc++-v3/ChangeLog:

	PR libstdc++/110853
	* include/bits/stl_pair.h [C++20] (pair(const T1&, const T2&)):
	Use std::type_identity_t<T1> for first parameter.
	* testsuite/20_util/pair/cons/110853.cc: New test.

Reviewed-by: Patrick Palka <ppalka@redhat.com>
Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
(cherry picked from commit 0bb0d1d288)
2025-09-04 17:35:10 +01:00
..
backward Update copyright years. 2023-01-16 11:52:17 +01:00
bits libstdc++: Make CTAD ignore pair(const T1&, const T2&) constructor [PR110853] 2025-09-04 17:35:10 +01:00
c Update copyright years. 2023-01-16 11:52:17 +01:00
c_compatibility libstdc++: Fix _Atomic(T) macro in <stdatomic.h> [PR115807] 2024-07-09 20:00:11 +01:00
c_global libstdc++: Use __promote_3 for std::hypot [PR121097] 2025-09-04 13:31:38 +01:00
c_std Update copyright years. 2023-01-16 11:52:17 +01:00
debug libstdc++: Disable __gnu_debug::__is_singular(T*) in constexpr [PR109517] 2025-03-31 12:05:17 +01:00
decimal Update copyright years. 2023-01-16 11:52:17 +01:00
experimental libstdc++: Fix find_last_set(simd_mask) to ignore padding bits 2024-06-21 18:22:28 +02:00
ext libstdc++: Do not use C++11 alignof in C++98 mode [PR104395] 2025-04-16 20:13:33 +01:00
parallel Update copyright years. 2023-01-16 11:52:17 +01:00
precompiled libstdc++: Fix some freestanding test failures 2023-04-05 18:45:15 +02:00
pstl libstdc++: Fix parallel std::exclusive_scan [PR108236] 2025-03-31 12:05:17 +01:00
std libstdc++: Fix std::format thousands separators when sign present [PR120548] 2025-06-11 09:01:51 +01:00
tr1 Update copyright years. 2023-01-16 11:52:17 +01:00
tr2 libstdc++: Fix std::tr2::dynamic_bitset shift operations [PR115399] 2024-10-04 10:09:15 +01:00
Makefile.am libstdc++: Include cstdarg in freestanding 2023-10-25 11:32:28 +01:00
Makefile.in libstdc++: Include cstdarg in freestanding 2023-10-25 11:32:28 +01:00