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]
Other format: [Raw text]

[Bug c++/52366] [c++11] static constexpr function cant initialize static constexpr


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52366

Ben Voigt <richardvoigt at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |richardvoigt at gmail dot
                   |                            |com

--- Comment #4 from Ben Voigt <richardvoigt at gmail dot com> 2012-07-17 20:32:26 UTC ---
No, this is not a duplicate.

This code involves a *brace-or-equal-initializer*, the code in 52315 does not,
and there are special rules for brace-or-equal-initializers in section 9.2 of
the Standard.  In particular, the class definition is complete inside the
initializer, although it isn't complete inside the array bounds in 52315.

"Within the class member-specification, the class is regarded as complete
within function bodies, default arguments, exception-specifications, and
brace-or-equal-initializers for non-static data members (including such things
in nested classes)."

Since this is a static data member, the exception doesn't apply, and this code
may in fact be invalid, but it isn't the same case as the other defect report.


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