From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5E5383857801; Thu, 22 Oct 2020 11:41:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5E5383857801 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/97328] [10/11 Regression] ICE in verify_ctor_sanity, at cp/constexpr.c:3995 since r10-7313-gb599bf9d6d1e180d Date: Thu, 22 Oct 2020 11:41:29 +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: 11.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.3 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 11:41:29 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97328 --- Comment #6 from CVS Commits --- The master branch has been updated by Patrick Palka : https://gcc.gnu.org/g:3d423c6f6a69d87ad52ba3af75f3debd8a8b8810 commit r11-4231-g3d423c6f6a69d87ad52ba3af75f3debd8a8b8810 Author: Patrick Palka Date: Thu Oct 22 07:40:40 2020 -0400 c++: Handle RANGE_EXPR index in init_subob_ctx [PR97328] In the testcase below, we're ICEing during constexpr evaluation of the CONSTRUCTOR {.data=3D{{}, [1 ... 7]=3D{}}} of type 'vector'. The inter= esting thing about this CONSTRUCTOR is that it has a RANGE_EXPR index for an element initializer which doesn't satisfy reduced_constant_expression_p (because the field 't' is uninitialized). This is a problem because init_subob_ctx currently punts on setting up a sub-aggregate initialization context when given a RANGE_EXPR index, so we later trip over the asserts in verify_ctor_sanity when recursing into cxx_eval_bare_aggregate on this element initializer. Fix this by making init_subob_ctx set up an appropriate initialization context when supplied a RANGE_EXPR index. gcc/cp/ChangeLog: PR c++/97328 * constexpr.c (init_subob_ctx): Don't punt on RANGE_EXPR indexes, instead build a sub-aggregate initialization context with no subobject. gcc/testsuite/ChangeLog: PR c++/97328 * g++.dg/cpp2a/constexpr-init19.C: New test. * g++.dg/cpp2a/constexpr-init20.C: New test.=