This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/82022] New: constexpr lambda in template context: expression ‘<lambda>’ is not a constant expression
- From: "bastien.penavayre at epitech dot eu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 29 Aug 2017 15:16:06 +0000
- Subject: [Bug c++/82022] New: constexpr lambda in template context: expression ‘<lambda>’ is not a constant expression
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82022
Bug ID: 82022
Summary: constexpr lambda in template context: expression
‘<lambda>’ is not a constant expression
Product: gcc
Version: 7.0.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: bastien.penavayre at epitech dot eu
Target Milestone: ---
Created attachment 42073
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42073&action=edit
source code
in a template context a constexpr lambda doesn't seem to be able to be
constexpr evaluated and its result is not constexpr.
if constexpr ([]() constexpr {return true;}()); //expression ‘<lambda>’ is not
a constant expression
constexpr bool r = []() constexpr {return true;}();
if constexpr (r); //"r" used in its own initializer