<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 22, 2013, at 16:08 , John McCall <<a href="mailto:rjmccall@apple.com">rjmccall@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Jan 22, 2013, at 2:58 PM, Alexander Zinenko <<a href="mailto:ftynse@gmail.com">ftynse@gmail.com</a>> wrote:</div><blockquote type="cite"><div dir="ltr"><div style="">The attached patch addresses <a href="http://llvm.org/bugs/show_bug.cgi?id=13824">http://llvm.org/bugs/show_bug.cgi?id=13824</a>. It emits a warning if reinterpret_cast is actually used to perform an upcast or a downcast which might lead to segfault in some cases.</div></div></blockquote><div><br></div>In most cases, this is actually safe, and I don't feel comfortable saying it's unreasonable for code to rely on that.  This warning should only fire when the base subobject is in a virtual base or at a nonzero static offset.</div><div><br></div><div>You can use a CXXBasePaths object with Sema::IsDerivedFrom in order to determine the subobject access path.</div></div></blockquote><br></div><div>I think I would still have a warning, since reinterpret_cast is harder to check statically and therefore is less future-proof. But I could see that warning being controlled by a separate flag.</div><div><br></div><div>Jordan</div><div><br></div></body></html>