https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110853

--- Comment #12 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Jonathan Wakely
<[email protected]>:

https://gcc.gnu.org/g:ac28c9730c14e7e6868c18420a803aed0d3935f1

commit r13-9867-gac28c9730c14e7e6868c18420a803aed0d3935f1
Author: Jonathan Wakely <[email protected]>
Date:   Tue Sep 2 22:30:46 2025 +0100

    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 <[email protected]>
    Reviewed-by: Tomasz KamiÅski <[email protected]>
    (cherry picked from commit 0bb0d1d2880d562298eeec8eee4ab4e8ba943260)
  • [Bug libstdc++/110853] [13 Regr... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to