diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 42a367dca531d..a3d9abb153778 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -11658,7 +11658,8 @@ static void NoteSurrogateCandidate(Sema &S, OverloadCandidate *Cand) { if (isRValueReference) FnType = S.Context.getRValueReferenceType(FnType); if (isLValueReference) FnType = S.Context.getLValueReferenceType(FnType); - if (Cand->FailureKind == ovl_fail_constraints_not_satisfied) { + if (!Cand->Viable && + Cand->FailureKind == ovl_fail_constraints_not_satisfied) { S.Diag(Cand->Surrogate->getLocation(), diag::note_ovl_surrogate_constraints_not_satisfied) << Cand->Surrogate;