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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <[email protected]>:

https://gcc.gnu.org/g:90ec6eeca09f5a411fd7878e2532a7ac2f2e3d71

commit r17-416-g90ec6eeca09f5a411fd7878e2532a7ac2f2e3d71
Author: Marek Polacek <[email protected]>
Date:   Thu May 7 18:09:57 2026 -0400

    c++: fix ICE with invalid targ [PR125043]

    The patch that allowed DECL_NTTP_OBJECT_P in invalid_tparm_referent_p
    also added the assert checking for tinfos/__func__ (r14-8189).  But in
    these tests we got to the assert with a temporary object coming from
    create_temporary_var: either a reference temporary or compound literal
    temporary.  The former could be checked by seeing if the name starts
    with _ZGR but the latter don't have it.  So perhaps we can just check
    DECL_IGNORED_P, always set for create_temporary_var objects.

            PR c++/115181
            PR c++/125043
            PR c++/124979

    gcc/cp/ChangeLog:

            * pt.cc (invalid_tparm_referent_p): Allow DECL_IGNORED_P in an
            assert.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp1z/nontype-auto27.C: New test.
            * g++.dg/cpp1z/nontype-auto28.C: New test.
            * g++.dg/cpp2a/nontype-class75.C: New test.

    Reviewed-by: Jason Merrill <[email protected]>

Reply via email to