This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 119a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-12-20
[Voted into WP at April, 2006 meeting.]
The C standard says in 6.3.2.3, paragraph 4:
Conversion of a null pointer to another pointer type yields a nullpointer of that type. Any two null pointers shall compare equal.
C++ appears to be incompatible with the first sentence in only twoareas:
A *a = 0; void *v = a;
C++ (7.3.12 [conv.ptr] paragraph 2) says nothing about thevalue ofv.
void *v = 0; A *b = (A*)v; // aka static_cast<A*>(v)
C++ (7.6.1.9 [expr.static.cast] paragraph 10) says nothing aboutthe value ofb.
Suggested changes:
Add the following sentence to 7.3.12 [conv.ptr] paragraph 2:
The null pointer value is converted to the null pointer value of thedestination type.
Add the following sentence to 7.6.1.9 [expr.static.cast] paragraph 10:
The null pointer value (7.3.12 [conv.ptr]) is convertedto the null pointer value of the destination type.
Proposed resolution (October, 2005):
Add the indicated words to 7.3.12 [conv.ptr] paragraph 2:
An rvalue of type “pointer tocvT,” whereT is an object type, can be converted to an rvalue of type “pointer tocvvoid”. The result of converting a “pointer tocvT” to a “pointertocvvoid” points to the start of the storagelocation where the object of typeT resides, as if the objectis a most derived object (6.8.2 [intro.object]) oftypeT (that is, not a base class subobject).The nullpointer value is converted to the null pointer value of thedestination type.
Add the indicated words to 7.6.1.9 [expr.static.cast] paragraph 11:
An rvalue of type “pointer tocv1void”can be converted to an rvalue of type “pointertocv2T,” whereT is an object typeandcv2 is the same cv-qualification as, or greatercv-qualification than,cv1.The null pointer value isconverted to the null pointer value of the destination type. Avalue of type pointer to object converted to “pointertocvvoid” and back, possibly with differentcv-qualification, shall have its original value...