Created on2017-02-08.00:00:00 last changed60 months ago
Proposed resolution (November, 2018):
Change 7.6.1.7 [expr.dynamic.cast] paragraphs 4-6 as follows:
If the value ofvis a null pointer value in the pointercase, the result is the null pointer value of typeT.IfTis “pointer tocv1B” andvhas type “pointer tocv2D” such thatB is a base classofD, the result is a pointer to theuniqueB subobject of theD object pointedto byv, or a null pointer value ifvis a null pointer value. Similarly, ifT is...
Otherwise,vshall be a pointer to or a glvalue of apolymorphic type (11.7.3 [class.virtual]).
Ifv is a null pointer value, the result is anull pointer value.
[Accepted as a DR at the February, 2019 meeting.]
From editorialissue1453.
According to 7.6.1.7 [expr.dynamic.cast] paragraph 4,
If the value ofvis a null pointer value in the pointer case, the resultis the null pointer value of typeT.
Paragraph 5 deals with the case of a simple up-cast, where no runtimetype identification is required. Paragraph 6 says,
Otherwise,v shall be a pointer to or a glvalue of a polymorphictype (11.7.3 [class.virtual]).
This organization of the material makes it sound as if the requirementfor polymorphic class types does not apply if the argument is a nullpointer value, which, of course, cannot be determined at compile time. Theintent is that a null pointer value argument produces a null pointer valueresult, regardless of whether the relationship between the classes requiresruntime type identification or not, but that the requirement forpolymorphic classes applies for all casts that are not simple up-casts. Thewording should be clarified.

| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2020-12-15 00:00:00 | admin | set | messages: +msg6379 |
| 2020-12-15 00:00:00 | admin | set | status: open -> cd5 |
| 2017-02-08 00:00:00 | admin | create | |