You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[expr.dynamic.cast]p1 says "The dynamic_cast operator shall not cast away constness." That makes some of the later wording redundant. Particulary p5:
"In both the pointer and reference cases, the program is ill-formed if cv2 has greater cv-qualification than cv1 or if B is an inaccessible or ambiguous base class of D."
(The "greater cv-qualification" part is pointless, and suggests incorrectly that this condition does not apply in the other cases in scope in this section.)
Also, p3 need not repeat the "same or more cv-qualification" part (which again has incorrect implications, in this case that we'd perform a runtime check if the cv-qualifications are incompatible).
While here, the p4 wording does not fit the pattern of this section (which is that you bail out early once you hit a matching paragraph). It incorrectly suggests that:
struct A { virtual ~A(); };
struct B : A {};
struct C : A, B {};
C *p = 0;
A *q = dynamic_cast<A*>(p);
... would be valid and produce a null pointer, because we never reach the "inaccessible or ambiguous" wording in p5.
The text was updated successfully, but these errors were encountered:
[expr.dynamic.cast]p1 says "The
dynamic_cast
operator shall not cast away constness." That makes some of the later wording redundant. Particulary p5:"In both the pointer and reference cases, the program is ill-formed if cv2 has greater cv-qualification than cv1 or if B is an inaccessible or ambiguous base class of D."
(The "greater cv-qualification" part is pointless, and suggests incorrectly that this condition does not apply in the other cases in scope in this section.)
Also, p3 need not repeat the "same or more cv-qualification" part (which again has incorrect implications, in this case that we'd perform a runtime check if the cv-qualifications are incompatible).
While here, the p4 wording does not fit the pattern of this section (which is that you bail out early once you hit a matching paragraph). It incorrectly suggests that:
... would be valid and produce a null pointer, because we never reach the "inaccessible or ambiguous" wording in p5.
The text was updated successfully, but these errors were encountered: