[Bug c++/122621] [15/16 regression] ICE on CTAD for alias template with constrained constructor

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Mar 28 18:50:27 GMT 2026


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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-15 branch has been updated by Patrick Palka
<ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:19fd49b059dcb7d48ca007a6a6ce91feec4d593c

commit r15-11008-g19fd49b059dcb7d48ca007a6a6ce91feec4d593c
Author: Patrick Palka <ppalka@redhat.com>
Date:   Mon Feb 9 20:32:39 2026 -0500

    c++: tf_partial and alias_ctad_tweaks [PR122621]

    Like in r15-6740-g27d620d6769715 for instantiate_template with dependent
    arguments, we also need to set tf_partial during the alias_ctad_tweaks
    transformation mainly for benefit of properly handling extra-args trees.

    In this testcase during alias_ctad_tweaks we substitute the dependent
    ElemTs={Tuple<Us...>}, Ts={Ts...} into the requires-clause, which
    tsubst_pack_expansion decides to defer via extra-args, and for the
    subsequent add_extra_args (during guide overload resolution) to merge
    the deferred dependent arguments correctly, tf_partial has to have been
    set.

            PR c++/122621

    gcc/cp/ChangeLog:

            * pt.cc (tsubst_pack_expansion): Use tf_partial instead of
            tf_none, except when substituting outer (non-dependent) template
            arguments.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/class-deduction-alias26.C: New test.

    Reviewed-by: Jason Merrill <jason@redhat.com>
    (cherry picked from commit bf2657d9d45e50c4eb82da3f6f8d9d26e288890f)


More information about the Gcc-bugs mailing list