<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 10, 2012, at 8:51 PM, Richard Smith wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote">On Tue, Apr 10, 2012 at 1:59 PM, Anna Zaks <span dir="ltr"><<a href="mailto:ganna@apple.com">ganna@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">
Added: cfe/trunk/test/Analysis/dynamic-cast.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/dynamic-cast.cpp?rev=154434&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/dynamic-cast.cpp?rev=154434&view=auto</a><br>

==============================================================================<br>
--- cfe/trunk/test/Analysis/dynamic-cast.cpp (added)<br>
+++ cfe/trunk/test/Analysis/dynamic-cast.cpp Tue Apr 10 15:59:00 2012<br></blockquote><div>[...] </div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">+// False negatives.<br>

+<br>
+// Symbolic regions are not typed, so we cannot deduce that the cast will<br>
+// always fail in this case.<br></blockquote><div><br></div><div>The cast won't always fail:</div><div><br></div><div>class D : public B, public C {};</div><div>int main() {</div><div>  D d;</div><div>  testDynCastFail1(&d);</div>
<div>}</div><div><br></div></div></blockquote><br>Thanks Richard! Looks like we cannot tell for sure unless we see the object creation site.</div><div><br></div><div>We still should track Types of symbolic regions in cases it can be proved that the cast succeeds, but should special case and not assume that the cast fails if the region is symbolic.<br><br></div><div>I'll commit an amended test case.</div><div><br></div><div><blockquote type="cite"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+int testDynCastFail1(class C *c) {<br>
+  B *b = 0;<br>
+  b = dynamic_cast<B*>(c);<br>
+  return b->m;<br>
+}</blockquote></div>
</blockquote></div><br></body></html>