static const double pi = 3.1415;

Mark Mitchell mark@codesourcery.com
Thu Feb 20 21:16:00 GMT 2003



--On Thursday, February 20, 2003 12:20:30 PM -0800 Mike Stump 
<mstump@apple.com> wrote:

> Hope that clarifies it.

Yes, that clarifies it.  Your patch is still incorrect in that it allow 
initializations of things that are not "const", unless I read it wrong. 
You simply return 0, which means you miss the other tests in that function.

In addition, I think we even less want to allow initializations for 
pointers.  The point is that the expressions allowed as initializers are 
extremely restricted because there is no definition of the static data 
member yet.  Until that happens -- outside the class-specifier -- you don't 
really have a good place to perform any complex computation.  The whole 
point of constant-expression is to provide a specification of what *must* 
be computed by the compiler at compile-time.

I'll accept this patch for 3.3, if you address the "const" issue, as a 
gradual transition, but I will argue very strongly against it for 3.4.

Go convince the committee first, then I'll be totally agreeable.

-- 
Mark Mitchell                mark@codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com



More information about the Gcc mailing list