================
@@ -11714,13 +11714,37 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl 
*Found, Decl *Templated,
     return;
   }
 
-  case TemplateDeductionResult::InvalidExplicitArguments:
+  case TemplateDeductionResult::InvalidExplicitArguments: {
     assert(ParamD && "no parameter found for invalid explicit arguments");
-    if (ParamD->getDeclName())
-      S.Diag(Templated->getLocation(),
-             diag::note_ovl_candidate_explicit_arg_mismatch_named)
-          << ParamD->getDeclName();
-    else {
+    if (ParamD->getDeclName()) {
----------------
AidanGoldfarb wrote:

Just added. A current message is like this:

```
template <typename T>
void case1(T value) {}

int main() {
    case1<42>(42);
}
```

```
source.cpp:44:5: error: no matching function for call to 'case1'
   44 |     case1<42>(42);
source.cpp:41:6: note: candidate template ignored: invalid explicitly-specified 
argument for template parameter 'T': expected a type, but got value '42' (of 
type 'int')
   40 | template <typename T>
      |           ~~~~~~~~~~
   41 | void case1(T value) {}
      |      ^
```
Perhaps it is a bit unclear having the highlight and caret on sequential lines, 
which both refer to the same function definition? If this format looks good I 
am happy to keep it, but I could foresee some confusion. 

https://github.com/llvm/llvm-project/pull/122754
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to