This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: static const double pi = 3.1415;
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Mike Stump <mstump at apple dot com>
- Cc: Mike Stump <mrs at apple dot com>, Phil Edwards <phil at jaj dot com>, Joe Buck <jbuck at synopsys dot com>, Gabriel Dos Reis <gdr at integrable-solutions dot net>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Thu, 20 Feb 2003 12:39:32 -0800
- Subject: 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