This is the mail archive of the gcc-bugs@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]

static const float initialization


It's perhaps no bug, but...

The egcs-1.0.2 and the gcc 2.8.1 allow the initialization of a static
constant floating point member in the class declaration.

The CD2 allows such behaviour only for constant integer members.

class X {
  static const int ix = 7; // OK
  static const double dx = 10.5;  // wrong
};

const int X::ix;
const double X::dx;


Ryszard Kabatek

Martin-Luther University Halle-Wittenberg
Department of Physical Chemistry
Geusaer Str. 88, 06217 Merseburg, Germany
Tel. +49 3461 46 2487 Fax. +49 3461 46 2129
e-mail: kabatek@chemie.uni-halle.de



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