N3721 Definition of the operands of _Generic --------------------------------------------- Author: Javier A. Múgica Purpose: Define an ambiguous concept Description ------------ There are various places in the standard that refer to the operands of an expression or an operator. For example: "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." "The value computations of the operands of an operator are sequenced before the value computation of the result of the operator." "The syntax specifies the precedence of operators in the evaluation of an expression, which is the same as the order of the major subclauses of this subclause, highest precedence first. Thus, for example, the expressions allowed as the operands of the binary + operator (6.5.7) are those expressions defined in 6.5.2 through 6.5.7. The exceptions are cast expressions (6.5.5) as operands of unary operators (6.5.4), and an operand contained between any of the following pairs of operators: grouping parentheses () (6.5.2), generic selection parentheses () (6.5.2.1), subscripting brackets [] (6.5.3.2), function-call parentheses () (6.5.3.3), and the conditional operator ?: (6.5.16)" "An integer constant expression has integer type and only has operands that are... " For a generic selection it is not clear what counts as its operands, other than its controlling operand. Therefore we present here a proposal for defining what the operands of _Generic are. In N3561 we presented two alternatives. The first one assumed that the type names in generic associations cannot be variably modified. N3348 changed this, so here we only keep the second alternative: Wording. 6.5.2.1 Generic selection ----------------------------------- Insert at the beginning of paragraph 3 (the first one in "Semantics") or, if it be preferred, under a "Description" section to be created. The operands of a generic selection are its generic controlling operand as well as the type names and the expressions from each generic association. ("and the" and not just "and", to make clear that a pair type-name + expression is not a single operand)