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