-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Full name of submitter (unless configured in github; will be published with the issue):
Corentin Jabot
Reference (section label):
[expr.sub]
Link to reflector thread (if any):
https://lists.isocpp.org/core/2022/04/12363.php
Issue description:
While CWG2507 add the missing wording for defaults arguments in [over.sub], it doesn't specify their evaluation order
relative to the postfix-expression.
For consistency with call expressions - and because it was not suggested it should be changed - the expressions (in the expression lists) evaluation order is left indeterminate.
It is unclear to me whether [over.match.oper] needs further massaging to cover the evaluation order for a subscript expression with not exactly one expression in its expression-list.
Suggested resolution:
Modify 7.6.1.2 [expr.sub]/p1
A [subscript expression is a postfix expression followed by square brackets containing a possibly empty,
comma-separated list of [initializer-clause]s which constitute the arguments to the subscript operator.
The [postfix-expression] is sequenced before each expression in the [expression-list]
+ and any default argument
.