This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
bug !? (in-class member constants initialization)
- To: egcs-bugs at cygnus dot com
- Subject: bug !? (in-class member constants initialization)
- From: Max Lawson <mlawson at drfmc dot ceng dot cea dot fr>
- Date: Sun, 7 Dec 1997 14:53:28 +0100
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