<div>This patch refactors the pointer arithmetic checking into a single place in SemaExpr.cpp. It provides two interfaces, one for checking a single pointer operand, one for checking both operands of a binary operator. The second interface goes to some lengths to DTRT for a mixture of good and bad operands on the LHS or RHS.</div>
<div><br></div><div>It also cleans up several aspects of the accompanying diagnostics to be more clearly worded, and provide more information when diagnosing (for example) both the LHS and RHS of a binary operator. It also makes the types shown be consistently shown as the pointee types instead of pointer types.</div>
<div><br></div><div>There is still a fair amount of cleanup I'd like to do here, potentially either simplifying some code, hooking up more clients to the code, and/or lifting more common checking into these routines. This should also help pave the way for a more principled place to perform warnings such as the NULL-pointer arithmetic warnings.</div>
<div><br></div><div>One thing I would be particularly interested in feedback on is the text of the warnings themselves. Any suggestions for further polish or wordsmithing would be great there. =]</div><div><br></div><div>
Patch is attached, and also available here: <a href="http://codereview.appspot.com/4631063/">http://codereview.appspot.com/4631063/</a></div>