diff options
author | David Blaikie <dblaikie@gmail.com> | 2019-05-03 00:44:50 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2019-05-03 00:44:50 +0000 |
commit | 6aecacbb8d3d7322d588b528a34a0425444dfafd (patch) | |
tree | f04375d141a02ecfec4c8b535096efa564ebed00 /include/clang/Sema/Overload.h | |
parent | b4f79aa4368802682268e2f39a29dd8f9b107b59 (diff) | |
download | clang-6aecacbb8d3d7322d588b528a34a0425444dfafd.tar.gz |
SemaOverload: Complete candidates before emitting the error, to ensure diagnostics emitted (or suppressed) during completion don't interfere with the overload notes
Because diagnostics and their notes are not connected at the API level,
if the error message for an overload is emitted, then the overload
candidates are completed - if a diagnostic is emitted during that work,
the notes related to overload candidates would be attached to the latter
diagnostic, not the original error. Sort of worse, if the latter
diagnostic was disabled, the notes are disabled.
Reviewers: rsmith
Differential Revision: https://reviews.llvm.org/D61357
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359854 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Sema/Overload.h')
-rw-r--r-- | include/clang/Sema/Overload.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/include/clang/Sema/Overload.h b/include/clang/Sema/Overload.h index f5490e8e63..342ce0f026 100644 --- a/include/clang/Sema/Overload.h +++ b/include/clang/Sema/Overload.h @@ -961,13 +961,23 @@ class Sema; OverloadingResult BestViableFunction(Sema &S, SourceLocation Loc, OverloadCandidateSet::iterator& Best); - void NoteCandidates(Sema &S, - OverloadCandidateDisplayKind OCD, - ArrayRef<Expr *> Args, + SmallVector<OverloadCandidate *, 32> CompleteCandidates( + Sema &S, OverloadCandidateDisplayKind OCD, ArrayRef<Expr *> Args, + SourceLocation OpLoc = SourceLocation(), + llvm::function_ref<bool(OverloadCandidate &)> Filter = + [](OverloadCandidate &) { return true; }); + + void NoteCandidates( + PartialDiagnosticAt PA, Sema &S, OverloadCandidateDisplayKind OCD, + ArrayRef<Expr *> Args, StringRef Opc = "", + SourceLocation Loc = SourceLocation(), + llvm::function_ref<bool(OverloadCandidate &)> Filter = + [](OverloadCandidate &) { return true; }); + + void NoteCandidates(Sema &S, ArrayRef<Expr *> Args, + ArrayRef<OverloadCandidate *> Cands, StringRef Opc = "", - SourceLocation Loc = SourceLocation(), - llvm::function_ref<bool(OverloadCandidate&)> Filter = - [](OverloadCandidate&) { return true; }); + SourceLocation OpLoc = SourceLocation()); }; bool isBetterOverloadCandidate(Sema &S, |