aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaOverload.cpp')
-rw-r--r--clang/lib/Sema/SemaOverload.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 7da09e8..1f25111 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -13208,7 +13208,10 @@ void OverloadCandidateSet::NoteCandidates(
auto Cands = CompleteCandidates(S, OCD, Args, OpLoc, Filter);
- S.Diag(PD.first, PD.second, shouldDeferDiags(S, Args, OpLoc));
+ {
+ Sema::DeferDiagsRAII RAII{S, shouldDeferDiags(S, Args, OpLoc)};
+ S.Diag(PD.first, PD.second);
+ }
// In WebAssembly we don't want to emit further diagnostics if a table is
// passed as an argument to a function.
@@ -13271,10 +13274,10 @@ void OverloadCandidateSet::NoteCandidates(Sema &S, ArrayRef<Expr *> Args,
// inform the future value of S.Diags.getNumOverloadCandidatesToShow().
S.Diags.overloadCandidatesShown(CandsShown);
- if (I != E)
- S.Diag(OpLoc, diag::note_ovl_too_many_candidates,
- shouldDeferDiags(S, Args, OpLoc))
- << int(E - I);
+ if (I != E) {
+ Sema::DeferDiagsRAII RAII{S, shouldDeferDiags(S, Args, OpLoc)};
+ S.Diag(OpLoc, diag::note_ovl_too_many_candidates) << int(E - I);
+ }
}
static SourceLocation