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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Jakub Jelinek
<ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:297d0efc13d73d36371583c2d6d6e7a47f88cd02

commit r13-7258-g297d0efc13d73d36371583c2d6d6e7a47f88cd02
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Thu Apr 27 11:36:54 2023 +0200

    c: Fix up error-recovery on non-empty VLA initializers [PR109409]

    On the following testcase we ICE, because after we emit the
    variable-sized object may not be initialized except with an empty
initializer
    error we don't really reset the initializer to error_mark_node and then at
    -Wformat checking time we ICE on seeing STRING_CST initializer for a VLA.

    The following patch just arranges for error_mark_node to be returned after
    the error diagnostics.

    2023-04-27  Jakub Jelinek  <ja...@redhat.com>

            PR c/109409
            * c-parser.cc (c_parser_initializer): Move diagnostics about
            initialization of variable sized object with non-empty initializer
            after c_parser_expr_no_commas call and ret.set_error (); after it.

            * gcc.dg/pr109409.c: New test.

    (cherry picked from commit d8842271ebf9a81128df9ae80e1d3b688749eac8)

Reply via email to