<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; "><div>This directly affects -Wobjc-literal-compare. In a private e-mail Chris suggested leaving the fixit on the warning itself (it was originally an error) since we're going to generate fairly useless code from what the user wrote 98% of the time. I (mildly) agree with Chandler about the meaning of fixits on warnings, though.</div><div><br></div><div>Currently -Wobjc-literal-compare actually DOES follow the fixit rule for ERRORS, that is, correct to use the fixit text even for CodeGen. This is not desirable behavior for this warning, but I don't know now whether to fix this by making it a note or just having Sema continue with the code as written. Chris implied the former is fine; Chandler says the latter would be preferred.</div><div><br></div><div>If we go with Chandler's interpretation (which is also what I remember from the discussion a few months ago) I'd still like to see the docs updated to point out that this needs to be <i>very</i> careful for warnings.</div><div><br></div><div>Seeking arbitration,</div><div>Jordan</div><div><br></div><br><div><div>On Jul 9, 2012, at 22:11 , Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">The decision we came to some time ago when discussing this on the mailing list was that the rule actually held, and the only valid fixit hint to issue on a warning is one which *does not impact* the AST produced or the recovery path.<div>
<br></div><div>For example, its valid to issue a warning with a fixit hint to correct 'struct' to 'class' (or vice versa) on a forward declaration which does not match the actual definition.</div><div><br>
</div><div>I think we have only a very few (if any) warnings left with fixit hints that, were they applied, would change the AST produced. And I think those should just be fixed to attach them to notes.</div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Jul 9, 2012 at 10:03 PM, Chris Lattner <span dir="ltr"><<a href="mailto:sabre@nondot.org" target="_blank">sabre@nondot.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: lattner<br>
Date: Tue Jul 10 00:03:05 2012<br>
New Revision: 159980<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=159980&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=159980&view=rev</a><br>
Log:<br>
Jordan points out that this was incorrect: clang should recover from<br>
*errors* with fixits on them by following the recovery advised by the<br>
fixit, but if it is a fixit on a warning, then obviously the AST<br>
should be for the code as-written.<br>
<br>
Modified:<br>
    cfe/trunk/docs/InternalsManual.html<br>
<br>
Modified: cfe/trunk/docs/InternalsManual.html<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/InternalsManual.html?rev=159980&r1=159979&r2=159980&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/InternalsManual.html?rev=159980&r1=159979&r2=159980&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/docs/InternalsManual.html (original)<br>
+++ cfe/trunk/docs/InternalsManual.html Tue Jul 10 00:03:05 2012<br>
@@ -453,8 +453,7 @@<br>
 <li>Since they are automatically applied if <code>-Xclang -fixit</code><br>
 is passed to the driver, they should only be used when it's very likely they<br>
 match the user's intent.</li><br>
-<li>Clang must recover from the error or warning as if the fix-it had been<br>
-applied.</li><br>
+<li>Clang must recover from errors as if the fix-it had been applied.</li><br>
 </ul><br>
<br>
 <p>If a fix-it can't obey these rules, put the fix-it on a note. Fix-its on<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">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>
</blockquote></div><br></div>
_______________________________________________<br>cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits<br></blockquote></div><br></body></html>