From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 378EB3858C27; Thu, 27 Apr 2023 09:41:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 378EB3858C27 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682588519; bh=z2lG+k8ap9mZB0U6rDrCBuQi/t4ax/KI7GGUaha8pmo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jFpqaU+CgTbhjG0CZLyV1Zqj2itRJYJuZV/7pT1DhmBWzJZNz+/ki13qMwgEIPu+x 2XV3yNmE4I5JB//kexCQOSFrD5N193RzPdsSl/wrRzH5XIMf8gZADuIW8Zir3MPb9A 0I7LXNtQSoKWIQ4RRM7R5PNtcCSyEkrgx8sFuQFI= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/107682] [13/14 Regression] ICE in c_parser_braced_init, at c/c-parser.cc:5619 Date: Thu, 27 Apr 2023 09:41:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: error-recovery, ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107682 --- Comment #6 from CVS Commits --- The releases/gcc-13 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:7e312adcb70ca7d67f0c2cf238cddec9b3243ff9 commit r13-7257-g7e312adcb70ca7d67f0c2cf238cddec9b3243ff9 Author: Jakub Jelinek Date: Thu Apr 27 11:35:55 2023 +0200 c: Fix up error-recovery on functions initialized as variables [PR10941= 2] The change to allow empty initializers in C broke error-recovery on the following testcase. We are emitting function %qD is initialized like a variable error early; if the initializer is non-empty, we just emit another error that the initializer is invalid. Previously if it was em= pty, we'd emit another error that scalar is being initialized by empty initializer (not really correct), but now we instead just try to build_zero_cst for the FUNCTION_TYPE and ICE on it. The following patch just emits the same diagnostics for the empty initializers as we emit for the non-empty ones. 2023-04-27 Jakub Jelinek PR c/107682 PR c/109412 * c-typeck.cc (pop_init_level): If constructor_type is FUNCTION_TYPE, reject empty initializer as invalid. * gcc.dg/pr109412.c: New test. (cherry picked from commit a1030fbf70eef5b635e4fbb904ec7209ebd137ca)=