This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: C++ PATCH: Disallow floating-point literals in integral-constant expressions
On Mon, Jan 31, 2005 at 05:52:24PM -0800, Mark Mitchell wrote:
> It is not true that if GCC X accepted a piece of code, but GCC X + 1
> does not, then we have removed a feature and must deprecate, etc.
In general this is true, but not in this case. You have removed a
well-known g++ extension that dates back to 1990, the first year that I
used g++. People then immediately discovered a number of instances where GNU
code breaks, and you want to fix all that code. This is not the right way
to do things (though of course it is appropriate to issue warnings when
-pedantic is present). This is a feature that has worked for 15 years.
GNU C++ always permitted static const members to be initialized in
the class (actually it used to allow the "static" to be omitted and
implied if there was an initializer, but I think that was removed a long
time ago). Until very late in the standardization process for ISO C++,
users had to use enums in a very illogical way to get true class constants
(that could be used for array sizes, etc). People pushed ANSI and ISO to
accept the GNU feature, at least for integral constants, and this was
done.