This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/8778: ICE on illegal initialization of non-integral staticin-class constant


The following reply was made to PR c++/8778; it has been noted by GNATS.

From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
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 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 <int n> 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
 
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]