From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 698 invoked by alias); 3 Dec 2002 14:56:06 -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 680 invoked by uid 71); 3 Dec 2002 14:56:05 -0000 Date: Tue, 03 Dec 2002 06:56:00 -0000 Message-ID: <20021203145605.679.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Wolfgang Bangerth Subject: Re: c++/8778: ICE on illegal initialization of non-integral static in-class constant Reply-To: Wolfgang Bangerth X-SW-Source: 2002-12/txt/msg00141.txt.bz2 List-Id: The following reply was made to PR c++/8778; it has been noted by GNATS. From: Wolfgang Bangerth To: Volker Reichelt Cc: gcc-gnats@gcc.gnu.org, , Subject: Re: c++/8778: ICE on illegal initialization of non-integral static in-class constant Date: Tue, 3 Dec 2002 08:53:54 -0600 (CST) Hi Volker, > I still don't agree with you ;-) Still not? I'm not arguing hard enough... > You can really compile the following with gcc!!! > > ------------------------snip here---------------------- > template struct A > { > static const int i[] = { 1, 2 }; // works > }; > > ------------------------snip here---------------------- I never doubted that you can compile it, but that does not make it legal. > 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[]' So maybe we can meet in the middle: "The code is illegal based on the C++ standard, but is accepted as a gcc extension"? The point is moot anyway, since we certainly agree that an ICE is not an appropriate behavior, the code being legal or not. Cheers :-) Wolfgang ------------------------------------------------------------------------- Wolfgang Bangerth email: bangerth@ticam.utexas.edu www: http://www.ticam.utexas.edu/~bangerth