From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21389 invoked by alias); 27 Aug 2010 18:06:41 -0000 Received: (qmail 21341 invoked by uid 48); 27 Aug 2010 18:06:28 -0000 Date: Fri, 27 Aug 2010 18:06:00 -0000 Message-ID: <20100827180628.21340.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/43453] Initialization of char array with string literal fails in mem-initializer In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "giecrilj at stegny dot 2a dot pl" 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: 2010-08/txt/msg02259.txt.bz2 ------- Comment #1 from giecrilj at stegny dot 2a dot pl 2010-08-27 18:06 ------- (In reply to comment #0) > Fails to compile, but should work: > > struct A { > char x[4]; > A():x("bug") { } > }; > > Error i get is: > > "main.cpp:3: error: array used as initializer" > Why do you think it should work? For example, the following equivalent code is invalid as well: char x [4] ("bug"); -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43453