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

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

https://gcc.gnu.org/g:57cd8665fea4c339369a43be017583621aa82fed

commit r14-10201-g57cd8665fea4c339369a43be017583621aa82fed
Author: Patrick Palka <ppa...@redhat.com>
Date:   Mon May 13 09:53:40 2024 -0400

    c++: nested aggregate/alias CTAD fixes [PR114974, PR114901, PR114903]

    During maybe_aggr_guide with a nested class template and paren init,
    like with list init we need to consider the generic template type rather
    than the partially instantiated type since partial instantiations don't
    have (partially instantiated) TYPE_FIELDS.  In turn we need to partially
    substitute PARMs in the paren init case as well.  As a drive-by improvement
    it seems better to use outer_template_args instead of DECL_TI_ARGS during
    this partial substitution so that we lower instead of substitute the
    innermost template parameters, which is generally more robust.

    And during alias_ctad_tweaks with a nested class template, even though
    the guides may be already partially instantiated we still need to
    substitute the outermost arguments into its constraints.

            PR c++/114974
            PR c++/114901
            PR c++/114903

    gcc/cp/ChangeLog:

            * pt.cc (maybe_aggr_guide): Fix obtaining TYPE_FIELDS in
            the paren init case.  Hoist out partial substitution logic
            to apply to the paren init case as well.
            (alias_ctad_tweaks): Substitute outer template arguments into
            a guide's constraints.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/class-deduction-aggr14.C: New test.
            * g++.dg/cpp2a/class-deduction-alias20.C: New test.
            * g++.dg/cpp2a/class-deduction-alias21.C: New test.

    Reviewed-by: Jason Merrill <ja...@redhat.com>
    (cherry picked from commit 6d31a370e26eeb950c326332633b3e8e84b6630b)

Reply via email to