I'm writing a C compiler which follows this standard, and if I parse statements like this:
int i;
(i) = 1;
my compiler will report an error which point out that (i) is a rvalue and should not be assignable.
I checked the code and the rules, and found this: in assignment expression semantics:
An assignment operator shall have a modifiable lvalue as its left operand.
An assignment expression has the value of the left operand after the assignment, but is not an lvalue.
In my case, the there are two assignment expressions:
(i) = 1 and i in parentheses. So the (i) should be a rvalue.
So my question is:
Is
(i) = 1 illegal in this C standard?