This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Static members in templates in egcs-1.0.1



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





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]