bug !? (in-class member constants initialization)
Max Lawson
mlawson@drfmc.ceng.cea.fr
Sun Dec 7 05:53:00 GMT 1997
Hi,
The testcase below compile with egcs-2.90.20 on my i586-pc-linux-glibc1 box
-----------------
#include <iostream.h>
template<class T>
class z
{
public:
static const T z_ = .001;
};
int main( )
{
cout << z<double>::z_ << "; " << z<int>::z_ << '\n';
return 0;
}
----------------------
the execution gives me a bogus behaviour:
$a.out
0.001; -755914244
Such in-class member constants initialisation is
only allowed for booleans and integers, isn't it ?
In this case, the compilation should fail. At least,
it should according to what is written in the last
edition of the c++ programming language.
Best regards, Max
More information about the Gcc-bugs
mailing list