Moved the logic for checking undefined behavior and its warnings into CheckCompatibleReinterpretCast(). Also, cleaned up the test case a little.<br><br><div class="gmail_quote">On Thu, Apr 28, 2011 at 8:46 PM, Argyrios Kyrtzidis <span dir="ltr"><<a href="mailto:kyrtzidis@apple.com">kyrtzidis@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div><div>One nitpick, I'd prefer that the DiagnosticLevel check is "close" in source code to the emission of the diagnostic.</div>
<div>Could you insert the DiagnosticLevel check in the two places where the diagnostic is emitted or change isCompatibleReinterpretCast</div><div>to a CheckCompatibleReinterpretCast function that does checks+warning ? isCompatibleReinterpretCast isn't used for anything else other than to emit the warning after all.</div>
<div><div></div><div class="h5"><div><br></div><div>On Apr 28, 2011, at 8:24 PM, Richard Trieu wrote:</div><br></div></div><blockquote type="cite"><div><div></div><div class="h5">Added the level check. There's two warning messages, so I added a check for each one.<br>
<br><div class="gmail_quote">On Thu, Apr 28, 2011 at 7:36 PM, Argyrios Kyrtzidis <span dir="ltr"><<a href="mailto:kyrtzidis@apple.com" target="_blank">kyrtzidis@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>You don't check whether the warning is turned off to skip the checks completely, something like</div>
<div><br></div><div>Diags.getDiagnosticLevel(diag::warn_pointer_indirection_from_incompatible_type, OpLoc) != Diagnostic::Ignored)</div><div><br></div><br><div><div><div></div><div><div>On Apr 28, 2011, at 7:16 PM, Richard Trieu wrote:</div>
<br></div></div><blockquote type="cite"><div><div></div><div>Changes to support the white list in [basic.lval]p10. There should be a corresponding test to each list item, except when those dealing with tag types since we are skipping them for now.<br>
<br><div class="gmail_quote">On Wed, Apr 27, 2011 at 6:11 PM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Apr 27, 2011, at 6:07 PM, Richard Trieu wrote:<br>
> Is there a way that Clang can check if the warning is turned off and skip the expensive checking?<br>
<br>
</div>Yes, you can check whether the current mapping for the diagnostic is still "ignore".<br>
<div><br>
> And did you mean the list in [basic.lval]p15? [basic.lval]p10 doesn't have a list.<br>
<br>
</div>We're just looking at different standards. :) C++11's [basic.lval]p10 is just minor wording differences from C++03's [basic.lval]p15.<br>
<font color="#888888"><br>
John.<br>
</font></blockquote></div><br>
</div></div><span><undefined-reinterpret-cast3.patch></span>_______________________________________________<div><br>cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br></div></blockquote></div><br></div>
</blockquote></div><br>
</div></div><span><undefined-reinterpret-cast4.patch></span></blockquote></div><br></div></blockquote></div><br>