N3890 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 second alternative was slighty preferred over the first. More important, 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. In addition to clarifying the current standard, future papers can benefit from the deffinition proposed here if they need to refer to the operands of _Generic or to the operands of expression in general. And more broadly, it is not good to have an operator for which its operands are not clearly defined. This proposal was discussed as N3721 at the March 2026 meeting. Some voices pointed that it would leave the standard in a broken state unless N3722 is also adopted. We cannot see how this can be so because the paper just defines a hitherto undefined concept. But in any case N3722 has been adopted. The sentence that this paper proposes to add is exactly the same as that in N3721, itself the same as the second alternative of N3561. Wording. 6.5.2.1 Generic selection ------------------------------------- Insert at the beginning of paragraph 3 (the first one under "Semantics"), as shown here: 3 The operands of a generic selection are its generic controlling operand as well as the type names and the expressions from each generic association. The generic controlling operand, size expressions, ...