This is the mail archive of the gcc@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: static const double pi = 3.1415;




--On Thursday, February 20, 2003 12:20:30 PM -0800 Mike Stump <mstump at apple dot 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 at codesourcery dot com
CodeSourcery, LLC            http://www.codesourcery.com


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