From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4232 invoked by alias); 29 May 2012 21:17:13 -0000 Received: (qmail 4220 invoked by uid 22791); 29 May 2012 21:17:12 -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; Tue, 29 May 2012 21:16:59 +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: Tue, 29 May 2012 22:14: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: ASSIGNED X-Bugzilla-Priority: P5 X-Bugzilla-Assigned-To: paolo.carlini at oracle dot com 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/msg02784.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D53494 --- Comment #14 from Daniel Kr=C3=BCgler 2012-05-29 21:16:57 UTC --- (In reply to comment #13) > Am I interpreting correctly that double braces are /required/ for std::ar= ray > init lists but only when the subtype has has a multivariable initializer = too? I must agree that the compiler behaviour does not look correct to me. Initi= ally I thought that the reason is due to the fact, that brace-elision does not a= pply here, but then I noticed that this code does not compile either: struct pair { pair(const char*, int) { } }; struct array_p { pair data[1]; }; array_p a =3D { { "smile", 1 } }; Here we have definitively brace elision in action, but I get the same error= as from Jonathan's example. My impression is that the compiler incorrectly does not see the brace-elision case here. Here is an example that works (with an expected [-Wmissing-braces] warning): struct string { string(const char*) { } }; struct array_s { string data[1]; }; array_s b{ "smile" }; =46rom this I see that gcc already implements http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1270 so I must conclude that the compiler should also accept the original exampl= e.