This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115d. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-10-26


2656. Converting consteval lambda to function pointer in non-immediate context

Section: 7.7  [expr.const]     Status: drafting     Submitter: Hubert Tong     Date: 2022-11-11

Converting a consteval lambda to a function pointer in a non-immediate context should be immediately-escalating.

Currently, this is well-formed:

  auto x = &*[]() consteval { return 42; };

Suggested resolution:

Make the conversion function of a lambda whose call operator is an immediate function also an immediate function.