This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21089] [4.0/4.1 Regression] C++ front-end does not "inline" the static const double
- From: "mark at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Oct 2005 17:05:38 -0000
- Subject: [Bug c++/21089] [4.0/4.1 Regression] C++ front-end does not "inline" the static const double
- References: <bug-21089-183@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #22 from mark at codesourcery dot com 2005-10-11 17:05 -------
Subject: Re: [4.0/4.1 Regression] C++ front-end does not "inline"
the static const double
sabre at nondot dot org wrote:
> ------- Comment #21 from sabre at nondot dot org 2005-10-11 17:03 -------
> "required optimization" doesn't make sense to me. To put it more clearly, do
> you agree that this:
>
> "In particular, I think the C++ standard specifies that memory is zero
> initialized and then ctors (within a translation unit) are run in order."
>
> statement is true, and that the code in comment 11 is valid?
Initializers are not constructors. You'll have to go read the section
of the standard I cited.
The code in comment #11 is valid -- but it must print 3.0, which may not
be what you expected.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21089