Implement a %plural modifier for complex plural forms in diagnostics. Use it in the overload diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59871 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index ba1bb25..96b229d 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -1309,16 +1309,11 @@
break;
case OR_No_Viable_Function:
- if (CandidateSet.empty())
- Diag(Fn->getSourceRange().getBegin(),
- diag::err_ovl_no_viable_function_in_call)
- << Ovl->getName() << Fn->getSourceRange();
- else {
- Diag(Fn->getSourceRange().getBegin(),
- diag::err_ovl_no_viable_function_in_call_with_cands)
- << Ovl->getName() << Fn->getSourceRange();
- PrintOverloadCandidates(CandidateSet, /*OnlyViable=*/false);
- }
+ Diag(Fn->getSourceRange().getBegin(),
+ diag::err_ovl_no_viable_function_in_call)
+ << Ovl->getName() << (unsigned)CandidateSet.size()
+ << Fn->getSourceRange();
+ PrintOverloadCandidates(CandidateSet, /*OnlyViable=*/false);
return true;
case OR_Ambiguous: