This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/64977] constexpr variable initialization by reference in lambda rejected
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 09 Mar 2016 05:08:19 +0000
- Subject: [Bug c++/64977] constexpr variable initialization by reference in lambda rejected
- Auto-submitted: auto-generated
- References: <bug-64977-4 at http dot gcc dot gnu dot org/bugzilla/>
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?