The C11 specification certainly does not make this clear, and is perhaps deficient.
I believe that foo.x is an lvalue with type other than int, but my justification is pretty weak:
6.2.7 paragraph 1 says:
Two types have compatible type if their types are the same.
6.3 paragraph 2 says:
Conversion of an operand value to a compatible type causes no change to the value or the representation.
If foo.x is an lvalue of type int, then it would be compatible with other ints so foo.x = 5 should result in foo.x having value 5 (per 6.3p2). That obviously can't happen, suggesting that foo.x is not compatible with int, suggesting that foo.x is not an lvalue of type int.
It doesn't really make sense that foo.x isn't compatible with int. Maybe no conversion (in the 6.3.1 sense) occurs, and that foo.x obtains its value via some mechanism not discussed in the standard. Or maybe I'm misunderstanding what "arithmetic operands" means, and that 6.3.1 doesn't apply to lvalues.
There's also 6.3.1.1 paragraph 1 bullet 2, which says:
- The rank of a signed integer type shall be greater than the rank of any signed integer type with less precision.
foo.x has less precision than an ordinary int (when used as an lvalue, not when it "is converted to the value stored in the designated object" as described in 6.3.2.1p2), so it must have a different integer conversion rank. This also suggests that it is not an int.
But I'm not sure that my interpretation is valid or matches the intention of the committee.
I would recommend submitting a defect report about thi
answered 2013-07-20T06:26:58.903