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

--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Uecker <[email protected]>:

https://gcc.gnu.org/g:67bc28c6c0c68a22280fd0942df598f20e339431

commit r17-366-g67bc28c6c0c68a22280fd0942df598f20e339431
Author: Martin Uecker <[email protected]>
Date:   Sat Apr 25 20:14:13 2026 +0200

    c: Fix use of variably-modified structure/union types in nested context
[PR124985]

    If a nested function uses a variably-modified structure or union type
    that depends on the enclosing context, it needs the static chain.
    My recent change missed this, because in this case no decl was used.
    To address this, we now call mark_decl_used also on TYPE_STUB_DECLs.

            PR c/124985

    gcc/c/ChangeLog:
            * c-decl.cc (pushtag): Update comment.
            (declspecs_add_type): Mark TYPE_STUB_DECL as used.
            * c-typeck.cc (function_to_pointer_conversion): Fix grammar in
comment.

    gcc/testsuite/ChangeLog:
            * gcc.dg/Wreturn-nested-3.c: New test.
            * gcc.dg/pr124985.c: New test.

Reply via email to