static const double pi = 3.1415;

Mike Stump mrs@apple.com
Sun Feb 16 02:21:00 GMT 2003


Ack!  I think this patch is going to screw the 3.3 release:

2002-12-09  Mark Mitchell  <mark@codesourcery.com>

         * NEWS: Document removal of in-class initialization extension 
for
         static data members of non-arithmetic, non-enumeration type.
         * decl.c (check_static_variable_definition): Do not allow that
         extension.
         * decl2.c (grokfield): Do not call digest_init when processing
         templates.

While technically correct, we generally pedwarn such things for a year 
or two or five to let people fix their broken code.  Going straight 
from GNU language feature to error will impact people.  If not pedwarn, 
then -fpermissive.

Thoughts?  I have a patch to do this, if we like the general idea.

Remind me, why was it really important to not let people use doubles?

class A {
   static const double pi = 3.1415;
} a;

This is taken from user code, Finder_FE.  :-(



More information about the Gcc mailing list