C++ PATCH: Disallow floating-point literals in integral-constant expressions

Mark Mitchell mark@codesourcery.com
Mon Feb 7 13:54:00 GMT 2005


Jonathan Wakely wrote:
> On Tue, Feb 01, 2005 at 11:55:58AM -0800, Mark Mitchell wrote:
> Is this OK?  Have I correctly described the extensions?  

Thank you for taking a stab at the documentation.

Not quite.  There are two completely orthogonal extensions: (1) we allow 
floating-point literals in integral constant expressions, and (2) we 
allow in-class initialization of static data members of floating-point type.

An example of (1) without (2) is something like:

   enum E { e = int(2.2 + 3.7) };

which is invalid ISO C++, but is accepted by G++, without -pedantic.

> Should I try to
> fix the alignment of the menu at the top of the file?

Joseph Myers is probably the right person to ask about that.

I think that you should also move these descriptions under "Deprecated 
Features", as nobody objected to deprecating this extension.

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304



More information about the Libstdc++ mailing list