-
Notifications
You must be signed in to change notification settings - Fork 785
Closed
Labels
cwgIssue must be reviewed by CWG.Issue must be reviewed by CWG.not-editorialIssue is not deemed editorial; the editorial issue is kept open for tracking.Issue is not deemed editorial; the editorial issue is kept open for tracking.
Description
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.
Metadata
Metadata
Assignees
Labels
cwgIssue must be reviewed by CWG.Issue must be reviewed by CWG.not-editorialIssue is not deemed editorial; the editorial issue is kept open for tracking.Issue is not deemed editorial; the editorial issue is kept open for tracking.