libstdc++/3738

Alexandre Oliva aoliva@redhat.com
Fri Aug 24 03:45:00 GMT 2001


On Aug 24, 2001, Luca Formaggia <Luca.Formaggia@epfl.ch> wrote:

> Well, for static integral constant member it should work, accordind to
> B.Stroustrup, 3rd Ed., pag 249, unless the standard has changed since then.

The ISO C++ Standard says all static data members referenced in a
program must be defined (outside the class body, as opposed to only
declared inside it), but they must omit the initializer if the
declaration already initializes it.  Note, however, that no diagnostic
is required in case this rule is violated, which means the compiler is
allowed, but not required to, replace references to the static data
member with the constant used to initialize them.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me



More information about the Gcc-bugs mailing list