This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2024-07-24
[Accepted as a DR at the March, 2024 meeting.]
(From submission #495.)
The phrasing in 7.6.6 [expr.add] bullet 4.2 excludes pointer arithmetic on a pointer pointing to the hypothetical (past-the-end) array element.
Proposed resolution (approved by CWG 2024-02-16):
Change in 7.6.6 [expr.add] bullet 4.2 as follows:
- ...
- Otherwise, if P points to
ana (possibly-hypothetical) array element i of an array object x with n elements (9.3.4.5 [dcl.array]), [ Footnote: ... ] the expressions P + J and J + P (where J has the value j) point to the (possibly-hypothetical) array element i + j of x if 0 <= i + j <= n and the expression P - J points to the (possibly-hypothetical) array element i - j of x if 0 <= i - j <= n.