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

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-15 branch has been updated by Patrick Palka
<[email protected]>:

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

commit r15-10711-gd549413f11d42872ad751c77afaa81b36a67639a
Author: Egas Ribeiro <[email protected]>
Date:   Sat Dec 13 13:14:47 2025 +0000

    c++: Fix ICE with type aliases in inherited CTAD [PR122070]

    When processing inherited CTAD in C++23, type_targs_deducible_from can
    be called with a synthetic alias template whose TREE_VALUE is a type
    alias.  Since TYPE_TEMPLATE_INFO_MAYBE_ALIAS can return NULL for type
    aliases, we need to fall back to TYPE_TEMPLATE_INFO to get the template
    info of the underlying type before calling TI_TEMPLATE, which should
    always be non-NULL when called from inherited_ctad_tweaks.

            PR c++/122070

    gcc/cp/ChangeLog:

            * pt.cc (type_targs_deducible_from): Fall back to
            TYPE_TEMPLATE_INFO when TYPE_TEMPLATE_INFO_MAYBE_ALIAS is NULL.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp23/class-deduction-inherited10.C: New test.
            * g++.dg/cpp23/class-deduction-inherited9.C: New test.

    Signed-off-by: Egas Ribeiro <[email protected]>
    Co-authored-by: Patrick Palka <[email protected]>
    Reviewed-by: Patrick Palka <[email protected]>
    (cherry picked from commit a0908b6723128799a68c9fdab65f65761f657488)

Reply via email to