<div class="gmail_quote">On Mon, Jan 3, 2011 at 10:57 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div class="gmail_quote"><div class="im"><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><div>Perhaps we could add this note as a follow-on when an expression statement consists of just a self-assignment?</div>
</div></div></div></blockquote><div>
<br></div></div><div>This is a good idea about how to key the fix-it hint. I'll submit this as a follow-up, and then run it over LLVM and Clang, as it seems we aren't immune to this code pattern. =D</div></div></div>
</blockquote><div><br></div><div>I'm finding this a bit ugly to implement... Currently, the diagnostic is nicely isolated in the expression building part of Sema.  This is nice because it can catch oddities like f(x = x);, but I don't see a nice way to check that this is the only component of the statement. We could just emit the notes from a separate routine in SemaStmt.cpp, and give it the same location? Is that the best way to do this?</div>
</div><br>