From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10024 invoked by alias); 30 May 2012 06:25:50 -0000 Received: (qmail 10008 invoked by uid 22791); 30 May 2012 06:25:49 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 30 May 2012 06:25:28 +0000 From: "daniel.kruegler at googlemail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/53494] [4.7/4.8 Regression] ICE with invalid initializer list Date: Wed, 30 May 2012 06:47:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: error-recovery, ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: daniel.kruegler at googlemail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P5 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.1 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-05/txt/msg02813.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D53494 --- Comment #18 from Daniel Kr=C3=BCgler 2012-05-30 06:25:27 UTC --- (In reply to comment #16) > "If the initializer-list begins with a left brace," >=20 > which it does >=20 > "then the succeeding comma-separated list of initializer-clauses initiali= zes > the members of a subaggregate;" >=20 > I read that to mean that { "smile", 1 } initializes the pair[1] >=20 > "it is erroneous for there to be more initializer-clauses than members." >=20 > There is only one member of pair[1] but two initializer-clauses. >=20 > So I think the error is required, but Daniel is usually right about such = things > so I'm not certain :) Thanks Jon. I agree with you, the wording seems clear. This looks like a ve= ry unfortunate language rule, because it leads to an inconsistency (from the user-point), when comparing this with non-aggregate list-initialization as = in the following case: std::initializer_list> lp =3D { {"a", 1} }; which is well-formed. I would like to withdraw my concerns expressed in com= ment 14 so that there is no hindrance to close this issue - anything else seems = to belong to a discussion at another place.