Bug in EGCS 1.1b (better than 1.0.3a though)
Christopher Curtis
ccurtis@ee.fit.edu
Fri Sep 18 07:33:00 GMT 1998
On 18 Sep 1998, Alexandre Oliva wrote:
Ack! Apologies...
> Christopher Curtis <ccurtis@ee.fit.edu> writes:
> > #include <complex>
> > template<class T> class MoreComplex : public complex<T> { private:
> > static int References = 0; };
> > int main( void ) { MoreComplex<double> Object; }
>
> On what platform? I can't reproduce the link error in 1.0.3. With
> 1.1, I get the following correct error messages:
>
> /home/msc/oliva/test.cc:6: ANSI C++ forbids in-class initialization of
> non-const static member `References'
I missed the 'non-const' ... portion of that. If that is indeed the spec,
then it's correct.
But if it is the spec, I don't get it. How can I ever have a sane
starting value for 'References'? Surely I can't put it in the constructor
as I don't want it reset with each new object...
1.0.3 gave me lots of wierd errors and an internal compiler error when I
drastically malformed my headers, too. I can't reproduce it at the
moment, though. I'll see if I can and try it with 1.1 and see if I get
the same error. Sorry for the chatter. =)
Christopher
More information about the Gcc-bugs
mailing list