This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: static const double pi = 3.1415;
kaih at khms dot westfalen dot de (Kai Henningsen) writes:
| Note I'm not arguing for or against any particular extension here.
|
| That said - what would be hard about allowing to initialize PODs with
| constant expressions?
I don't know how hard it would be. But I do know for sure that a
couple of bugs on that issue have made their ways into the compiler.
Getting rid of that undocumented extension certainly makes the job of
implementing the language easier.
Now, if you want that feature, maybe you might come with a detailled
specification -- no, the undocumented extension didn't describe the
semantics.
what is clear is that integral constant and enumeration are considered
compile-time entities and as such maybe "optimized" away by the
compiler -- that is the main prupose of the standard feature.
However, the picture is less clear when you consider non-compile time
entities.
-- Gaby