6.3.2.1 Lvalues, arrays, and function designators

Previous Table of Contents

717 An lvalue is an expression with an object type or an incomplete type other than void;53)

718 if an lvalue does not designate an object when it is evaluated, the behavior is undefined.

719 When an object is said to have a particular type, the type is specified by the lvalue used to designate the object.

720 A modifiable lvalue is an lvalue that does not have array type, does not have an incomplete type, does not have a const-qualified type, and if it is a structure or union, does not have any member (including, recursively, any member or element of all contained aggregates or unions) with a const-qualified type.

721 Except when it is the operand of the sizeof operator, the unary & operator, the ++ operator, the -- operator, or the left operand of the . operator or an assignment operator, an lvalue that does not have array type is converted to the value stored in the designated object (and is no longer an lvalue).

722 If the lvalue has qualified type, the value has the unqualified version of the type of the lvalue;

723 otherwise, the value has the type of the lvalue.

724 If the lvalue has an incomplete type and does not have array type, the behavior is undefined.

725 Except when it is the operand of the sizeof operator or the unary & operator, or is a string literal used to initialize an array, an expression that has type “array of type” is converted to an expression with type “pointer to type” that points to the initial element of the array object and is not an lvalue.

726 If the array object has register storage class, the behavior is undefined.

727 A function designator is an expression that has function type.

728 Except when it is the operand of the sizeof operator54) or the unary & operator, a function designator with type “function returning type” is converted to an expression that has type “pointer to function returning type”.

729 Forward references: address and indirection operators (6.5.3.2), assignment operators (6.5.16), common definitions <stddef.h> (7.17), initialization (6.7.8), postfix increment and decrement operators (6.5.2.4), prefix increment and decrement operators (6.5.3.1), the sizeof operator (6.5.3.4), structure and union members (6.5.2.3).

730 53) The name “lvalue” comes originally from the assignment expression E1 = E2, in which the left operand E1 is required to be a (modifiable) lvalue.

731 It is perhaps better considered as representing an object “locator value”.

732 What is sometimes called “rvalue” is in this International Standard described as the “value of an expression”.

733 An obvious example of an lvalue is an identifier of an object.

734 As a further example, if E is a unary expression that is a pointer to an object, *E is an lvalue that designates the object to which E points.

735 54) Because this conversion does not occur, the operand of the sizeof operator remains a function designator and violates the constraint in 6.5.3.4.

Next

Created at: 2005-06-29 02:18:56 The text from WG14/N1124 is copyright © ISO