[expr.dynamic.cast] CWG 2365: Incorrect wording regarding dynamic_cast #1453
Labels
cwg
Issue must be reviewed by CWG.
not-editorial
Issue is not deemed editorial; the editorial issue is kept open for tracking.
In paragraph 4, http://eel.is/c++draft/expr.dynamic.cast#4
If the value of v is a null pointer value in the pointer case, the result is the null pointer value of type T.
And in paragraph6,
Otherwise, v shall be a pointer to or a glvalue of a polymorphic type.
So the otherwise means the v in p4 doesn't have to be polymorphic.
However, this is not possible because the compiler can only check if "v" is a null pointer at runtime. If "v" is not a null pointer, and unluckily has no RTTI, then the runtime could do nothing meaningufl, ill-formed?
BTW, Clang and GCC requires the "v" in p4 to be of pointer to polymorphic type.
The text was updated successfully, but these errors were encountered: