cplusplus / nbballot

Handling of NB comments in response to ballots
14 stars 4 forks source link

FR-019-005 7.7 [expr.const] Defer evaluation of consteval functions in default arguments CWG2631 #421

Closed wg21bot closed 1 year ago

wg21bot commented 1 year ago

Because source_location is a consteval function, it is immediately evaluated in default arguments, producing a source location information for the location of the function declaration, which makes source_location unusable for the purposes it was designed.

The behaviour of consteval function in default argument is otherwise inconsistent as in other circumstances, default arguments are always evaluated at the point of call.

Please adopt CWG2631

jensmaurer commented 1 year ago

CWG 2022-11-08: Accepted with Modifications. See CWG2631 for details.

tkoeppe commented 1 year ago

P2710R0 does not seem to call out this NB comment.

jensmaurer commented 1 year ago

Indeed; clerical error in P2710R0. I've just updated CWG2631 as represented in the issues list.