-
Notifications
You must be signed in to change notification settings - Fork 773
[intro.execution] p7 value computation vs. prvalue #5477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This part seemly only covers lvalue-to-rvalue conversion, which is a bit problematic.
Initialization is not modification, although IMO explicitly creating an object within a byte array should also contain modifications... Is this part touching the same issue as cplusplus/CWG#38? |
IMO, a
which consider the lvalue-to-rvalue conversion as a part of evaluation of a prvalue. constexpr int v = a; the converted
we all agree the initialization of an object is not a side effect. This issue just claims to clarify value computation and whether lvalue-to-rvalue is considered to be part of the evaluation of a prvalue. |
[intro.execution] p7 says
Consider the sentence in the parenthesis
This is exact the definition of glvalue per [basic.lval] p 1.1
It could be understood that the evaluation of a glvalue is a kind of value computation. However, the emphasized part is a bit strange:
This sounds like the duty of the lvalue-to-rvalue conversion. What if an expression itself is a prvalue(e.g.
0 + int{1};
)? Shall we just sayThis is one function of the evaluation of prvalue
It is not sure whether the initialization of the result object of a prvalue takes account to be the value computation? After all, we just define the side effect as
We define "modifying an object" with the cross-reference to ([expr.ass], [expr.post.incr], [expr.pre.incr]), in [dcl.type.cv]
however, they are not about initialization.
The text was updated successfully, but these errors were encountered: