This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Static members in templates in egcs-1.0.1
- To: mmitchell at usa dot net
- Subject: Re: Static members in templates in egcs-1.0.1
- From: Joe Buck <jbuck at synopsys dot com>
- Date: Wed, 14 Jan 98 9:54:25 PST
- Cc: erik at arbat dot com, egcs at cygnus dot com
> Note that in theory, you should not use in-class initialization with
> non-const static data members; with -pedantic, g++ correctly says:
>
> supernova% g++ -pedantic test.C
> test.C:6: warning: ANSI C++ forbids in-class initialization of
> non-const static member `mycounter'
Since g++ does not generate correct code for this case (using the
in-class initialization for static template data members), it may
as well always issue an error. I think that now that ANSI supports
the most useful case (a static const member can be initialized in the
class declaration) we should get rid of the other cases.