HomePhabricator

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

Authored by jlebar on Jan 30 2021, 7:00 PM.

Description

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

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.

Differential Revision: https://reviews.llvm.org/D95754