From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30519 invoked by alias); 3 Dec 2002 00:36:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 30503 invoked by uid 71); 3 Dec 2002 00:36:01 -0000 Date: Mon, 02 Dec 2002 16:36:00 -0000 Message-ID: <20021203003601.30502.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Volker Reichelt Subject: Re: c++/8778: ICE on illegal initialization of non-integral static in-class constant Reply-To: Volker Reichelt X-SW-Source: 2002-12/txt/msg00107.txt.bz2 List-Id: The following reply was made to PR c++/8778; it has been noted by GNATS. From: Volker Reichelt To: bangerth@ticam.utexas.edu Cc: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, sgunderson@bigfoot.com Subject: Re: c++/8778: ICE on illegal initialization of non-integral static in-class constant Date: Tue, 3 Dec 2002 02:28:07 +0100 Dear Wolfgang, I still don't agree with you ;-) On 2 Dec, Wolfgang Bangerth wrote: >> Initializing const arrays is usually supported by gcc. > > True, but not as static member variables. You can really compile the following with gcc!!! ------------------------snip here---------------------- template struct A { static const int i[] = { 1, 2 }; // works }; ------------------------snip here---------------------- Only with -pedantic you'll get a warning: test.cc:3: warning: ISO C++ forbids initialization of member constant `i' of non-integral type `const int[]' >> In fact, the code compiles if you just leave out the curly >> braces around the initializer. That refers to the original testcase. Just try it! Best regards, Volker