[Bug c++/64977] constexpr variable initialization by reference in lambda rejected
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Mar 9 05:08:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64977
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |msebor at gcc dot gnu.org
Summary|GCC incorrectly rejects |constexpr variable
|constexpr variable |initialization by reference
|definition. |in lambda rejected
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
I'm not 100% sure this example is valid. It seems to me that the rejected
initializer "e" is invalid because it's not
a core constant expression. I.e., it's a capture by reference, which is "an
id-expression that refers to a variable or data member of reference type [that]
has a preceding initialization" but the reference isn't "initialized with a
constant expression" (a is not a constant expression). Is there something I'm
missing?
More information about the Gcc-bugs
mailing list