Static members in templates in egcs-1.0.1

Joe Buck jbuck@synopsys.com
Wed Jan 14 23:17:00 GMT 1998


> 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.






More information about the Gcc mailing list