cplusplus / nbballot

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

JP3-023 7.7 p18.2 [expr.const] A non-const variable passed to immediate function #565

Closed jensmaurer closed 9 months ago

jensmaurer commented 9 months ago

A non-const variable is passed to an immediate function.

insert "const " before "int x = 0;"

jensmaurer commented 9 months ago

The example is correct as-written. The immediate function is not invoked right away, because it is in a default argument.

jensmaurer commented 9 months ago

CWG: Clarify error is because of evaluation of id.

jensmaurer commented 9 months ago

Accepted with modifications. The example is written as intended. The comments in the example have been amended to clarify the exposition.