When printing an overload candidate that is a function template specialization,
point at the template and print out its template arguments, e.g.,
ambiguous-ovl-print.cpp:5:8: note: candidate function template specialization
[with T = int]
void f(T*, long);
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81907 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index cda7c82..33766f9 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -3831,6 +3831,13 @@
// Deleted or "unavailable" function.
Diag(Cand->Function->getLocation(), diag::err_ovl_candidate_deleted)
<< Cand->Function->isDeleted();
+ } else if (FunctionTemplateDecl *FunTmpl
+ = Cand->Function->getPrimaryTemplate()) {
+ // Function template specialization
+ // FIXME: Give a better reason!
+ Diag(Cand->Function->getLocation(), diag::err_ovl_template_candidate)
+ << getTemplateArgumentBindingsText(FunTmpl->getTemplateParameters(),
+ *Cand->Function->getTemplateSpecializationArgs());
} else {
// Normal function
// FIXME: Give a better reason!