<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 10, 2011, at 10:39 PM, Nikola Smiljanic wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote">On Fri, Jul 29, 2011 at 5:57 PM, Douglas Gregor <span dir="ltr"><<a href="mailto:dgregor@apple.com">dgregor@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 class="im"><br>
<br>
</div>The -ferror-limit logic is clipping notes when it shouldn't.<br>
<br>
        - Doug<br>
<div><div></div><div class="h5"><br>
</div></div></blockquote></div><br><div>Clang emits a fatal error (fatal_too_many_errors) when the error limit is reached and this clips all subsequent diagnostics. Here's a patch that allows notes to be emitted even after the fatal error. The question is what kind of diagnostics does error-limit filter, everything, only errors, warnings + errors? If it only filters errors then we should also allow warnings to be emitted.</div>

<span><error-limit_clipping_notes.patch></span></blockquote></div><div><br></div><div>@@ -703,7 +703,7 @@</div><div><br></div><div> </div><div>   // If a fatal error has already been emitted, silence all subsequent</div><div>   // diagnostics.</div><div>-  if (Diag.FatalErrorOccurred) {</div><div>+  if (Diag.FatalErrorOccurred && DiagLevel != DiagnosticIDs::Note) {</div><div>     if (DiagLevel >= DiagnosticIDs::Error &&</div><div>         Diag.Client->IncludeInDiagnosticCounts()) {</div><div>       ++Diag.NumErrors;</div><div><br></div><div>This doesn't look right… it looks like it'll allow *all* notes to be printed, even if the warning/error preceding that note was suppressed. What we really want is for the notes corresponding to the last displayed error to be displayed, but subsequent notes should still be suppressed.</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">       </span>- Doug</div></body></html>