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++/64977] constexpr variable initialization by reference in lambda rejected


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?

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