jlebar added a comment.

Thank you for your comments, Aaron!



================
Comment at: clang/lib/Sema/Sema.cpp:2310
 
+  S.Diags.noteNumOverloadCandidatesShown(ShownOverloads);
+
----------------
aaronpuchert wrote:
> Why not in the following `if`? I assume we want to show a long list not 
> necessarily once, but only if it comes with the first error?
My intent was to show the long list once, even if it's not the very first 
error.  My thought process:

All things being equal, it's better to show more information to the user than 
less.  The problem is, at some point, the amount of information we show becomes 
overwhelming and spammy.  Particularly problematic are multiline errors, 
because then you get O(nm) error lines across the whole TU.  We prevent the 
O(nm) overwhelm by limiting the number of lines a particular error can produce 
(using the mechanism in question here, or the template backtrace limit, etc), 
and then also limiting the total number of individual errors before we stop 
printing those.

With this change, we display the full(ish) error the first time it occurs and 
then the truncated error every other time.  So in total it's O(n + m) rather 
than O(nm).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95754/new/

https://reviews.llvm.org/D95754

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to