[PATCH] D95754: [clang] Print 32 candidates on the first failure, with -fshow-overloads=best.

Justin Lebar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 30 19:05:41 PST 2021


jlebar created this revision.
jlebar requested review of this revision.
Herald added a project: clang.

Previously, -fshow-overloads=best always showed 4 candidates.  The
problem is, when this isn't enough, you're kind of up a creek; the only
option available is to recompile with different flags.  This can be
quite expensive!

With this change, we try to strike a compromise.  The *first* error with
more than 4 candidates will show up to 32 candidates.  All further
errors continue to show only 4 candidates.

The hope is that this way, users will have *some chance* of making
forward progress, without facing unbounded amounts of error spam.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95754

Files:
  clang/include/clang/Basic/Diagnostic.h
  clang/lib/Sema/Sema.cpp
  clang/lib/Sema/SemaOverload.cpp
  clang/test/SemaCXX/ambiguous-conversion-show-overload.cpp
  clang/test/SemaCXX/overloaded-builtin-operators.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95754.320335.patch
Type: text/x-patch
Size: 6940 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210131/03aa86f5/attachment.bin>


More information about the cfe-commits mailing list