P
Peter Nilsson
Keith Thompson said:pete said:Is this an expression:
(5)
?
N869
6.5 Expressions
[#1] An expression is a sequence of operators and operands
that specifies computation of a value, or that designates an
object or a function, or that generates side effects, or
that performs a combination thereof.
I see two punctuators and an integer constant,
but no operators and no operand.
I don't know if "computation" means "evaluation".
The grammar clearly implies that
(5)
or just
5
is an expression. (A constant is a primary-expression, which is a
postfix-expression, which (skipping a few steps) is an expression.)
The wording of the definition in 6.5 just barely misses capturing the
obvious intent. (No, 5 is not an operand in this context; the word
"operand" is defined in 6.4.6 as "an entity on which an operator
acts", and there's no operator.)
It's probably worthwhile to fix the wording, but not to spend too much
time worrying about it.
What exactly is wrong with 6.5.1p5 in this case?