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

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

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

commit r16-7973-gf42bbef5c0a66881ec2fd41ab3ac3e2860080018
Author: Andrew Pinski <[email protected]>
Date:   Mon Mar 9 15:38:33 2026 -0700

    c: Fix ICE after an error: typedef and old style prototypes for nested
functions [PR123461]

    This started to ICE after r16-3747-gafa74d37e8170d which added
    a call to mark_decl_used. You can't call mark_decl_used with a
    typedef which is an error mark as you get an ICE.
    There is a check right after the newly added call for error mark,
    so let's move the call to inside that block instead.

    Bootstrapped and tested on x86_64-linux-gnu.

            PR c/123461

    gcc/c/ChangeLog:

            * c-decl.cc (declspecs_add_type): Move mark_decl_used
            call after the check for error mark node.

    gcc/testsuite/ChangeLog:

            * gcc.dg/pr123461-1.c: New test.

    Signed-off-by: Andrew Pinski <[email protected]>

Reply via email to