cplusplus / CWG

Core Working Group
24 stars 7 forks source link

CWG2656 [expr.const] Converting consteval lambda to function pointer in non-immediate context #173

Open hubert-reinterpretcast opened 1 year ago

hubert-reinterpretcast commented 1 year ago

Full name of submitter (unless configured in github; will be published with the issue): Hubert Tong

Reference (section label): expr.const

Link to reflector thread (if any): N/A

Issue description: 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.

jensmaurer commented 1 year ago

CWG2656