This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-08-11
1504. Pointer arithmetic after derived-base conversionSection: 7.6.6 [expr.add] Status: CD3 Submitter: Loïc Joly Date: 2012-05-20[Moved to DR at the April, 2013 meeting.]
The current wording is not sufficiently clear that a pointer to a base class subobject of an array element cannot be used in pointer arithmetic.
Proposed resolution (October, 2012):
Add the following as a new paragraph before 7.6.6 [expr.add] paragraph 7:
For addition or subtraction, if the expressions P or Q have type “pointer to cv T", where T is different from the cv-unqualified array element type, the behavior is undefined. [Note: In particular, a pointer to a base class cannot be used for pointer arithmetic when the array contains objects of a derived class type. —end note]
If the value 0 is added to or subtracted...
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4