Open xmh0511 opened 5 months ago
CWG2861
We currently define "dynamic type" only for expressions, not objects. Maybe we can say
Otherwise, if
v
has type "pointer to cvU
" andv
does not point to an object whose type is similar toU
, the behavior is undefined. Ifv
is a glvalue of type "cvU
" andv
does not refer to an object whose type is similar toU
, the behavior is undefined.
This also addresses the case of "what object?" when v
is a past-the-end pointer.
Agreed, fixed.
Full name of submitter (unless configured in github; will be published with the issue): Jim X
Consider this example:
This example just causes the segment fault in major implementations. However, [expr.dynamic.cast] does not specify the behavior for this case.
Suggested Resolution
Append a wording before [expr.dynamic.cast] p7