]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Make CTAD ignore tuple(const Types&...) constructor [PR121771]
authorJonathan Wakely <jwakely@redhat.com>
Wed, 11 Feb 2026 22:39:52 +0000 (22:39 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 13 Feb 2026 09:06:31 +0000 (09:06 +0000)
commit7bafcc36172b572296731df951df4b0caa019b95
tree2c6aae51d161a3dc59083de9622bd05647d1222b
parent705d87ba8e987cb8e0ca8b6d400c0aff8739eb23
libstdc++: Make CTAD ignore tuple(const Types&...) constructor [PR121771]

This is similar to the r16-3536-g0bb0d1d2880d56 change for std::pair, so
that CTAD ignores the tuple(const Types&...) constructor and only uses
the tuple(Types...) -> tuple<Types...> deduction guide. This ensures
that the deduced type comes from the decayed argument types.

libstdc++-v3/ChangeLog:

PR libstdc++/121771
* include/std/tuple (tuple::tuple(const Elements&...)): Use
type_identity_t to prevent constructor being used for CTAD.
(tuple::tuple(allocator_arg_t, const A&, const Elements&...)):
Likewise.
* testsuite/20_util/tuple/cons/121771.cc: New test.

Reviewed-by: Ville Voutilainen <ville.voutilainen@gmail.com>
libstdc++-v3/include/std/tuple
libstdc++-v3/testsuite/20_util/tuple/cons/121771.cc [new file with mode: 0644]