You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[basic.lval] p5 clearly defines the result of an expression, that is
The result of a glvalue is the entity denoted by the expression. The result of a prvalue is the value that the expression stores into its context; a prvalue that has type cv void has no result.
An expression is either a glvalue or a prvalue. The result of an expression is an object or function if the expression is glvalue or the value of a prvalue otherwise. However, in [expr.compound], we do not give such wording a consistent meaning. Such as [expr.cond] p1
It is evaluated and if it is true, the result of the conditional expression is the value of the second expression, otherwise that of the third expression.
the conditional expression is either a glvalue or a prvalue, the result of it is an object or function if it's a glvalue, or the value if it's a prvalue.
[expr.cond] p5
If the second and third operands are glvalues of the same value category and have the same type, the result is of that type and value category and it is a bit-field if the second or the third operand is a bit-field, or if both are bit-fields.
Saying that the result is a bit-field conforms to the definition of the result of a glvalue; a bit-field is an entity, it has no problem. However, saying that the result is of that type and value category seems to imply that the "result" means an expression, only expressions can have a value category. It is contradictory.
Such as [expr.comma] p1
The type and value of the result are the type and value of the right operand; the result is of the same value category as its right operand, and is a bit-field if its right operand is a bit-field.
Again, the comma expression is either a glvalue or prvalue. If it is a glvalue, the result of the comma expression is an entity per [basic.lval] p5, otherwise the value of the prvalue. We can see the first part and the second part of [expr.comma] p1 implies the result different meaning.
the result is of the same value category as its right operand
In this wording, The "result" is viewed as an expression.
is a bit-field if its right operand is a bit-field.
While in this wording, the "result" has the same definition as [basic.lval] p5 says. I just list the part of [expr.compound], the result of the expression has a different meaning, as above pointed, in its subclasses. It is better to say
The expression has the same value category, type, and result as that of E.
E for example is the second or third operand, the updated operand, or so on.
The text was updated successfully, but these errors were encountered:
[basic.lval] p5 clearly defines the result of an expression, that is
An expression is either a glvalue or a prvalue. The result of an expression is an object or function if the expression is glvalue or the value of a prvalue otherwise. However, in [expr.compound], we do not give such wording a consistent meaning. Such as [expr.cond] p1
the conditional expression is either a glvalue or a prvalue, the result of it is an object or function if it's a glvalue, or the value if it's a prvalue.
[expr.cond] p5
Saying that the result is a bit-field conforms to the definition of the result of a glvalue; a bit-field is an entity, it has no problem. However, saying that the result is of that type and value category seems to imply that the "result" means an expression, only expressions can have a value category. It is contradictory.
Such as [expr.comma] p1
Again, the comma expression is either a glvalue or prvalue. If it is a glvalue, the result of the comma expression is an entity per [basic.lval] p5, otherwise the value of the prvalue. We can see the first part and the second part of [expr.comma] p1 implies the result different meaning.
In this wording, The "result" is viewed as an expression.
While in this wording, the "result" has the same definition as [basic.lval] p5 says. I just list the part of [expr.compound], the result of the expression has a different meaning, as above pointed, in its subclasses. It is better to say
E
for example is the second or third operand, the updated operand, or so on.The text was updated successfully, but these errors were encountered: