[all-commits] [llvm/llvm-project] c90dac: [clang] Print 32 candidates on the first failure, ...

Justin Lebar via All-commits all-commits at lists.llvm.org
Thu Feb 25 17:47:17 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c90dac27e94ec354a3e8919556ac5bc89b62c731
      https://github.com/llvm/llvm-project/commit/c90dac27e94ec354a3e8919556ac5bc89b62c731
  Author: Justin Lebar <justin.lebar at gmail.com>
  Date:   2021-02-25 (Thu, 25 Feb 2021)

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

  Log Message:
  -----------
  [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




More information about the All-commits mailing list