[clang] [clang][Sema] Improve template argument deduction diagnostic (PR #122754)
Vlad Serebrennikov via cfe-commits
cfe-commits at lists.llvm.org
Sun Jan 26 15:28:10 PST 2025
================
@@ -649,15 +649,15 @@ namespace cwg241 { // cwg241: 9
A::g<3>(b);
C::f<3>(b);
// expected-error at -1 {{no matching function for call to 'f'}}
- // expected-note@#cwg241-C-f {{candidate template ignored: invalid explicitly-specified argument for template parameter 'T'}}
+ // expected-note@#cwg241-C-f {{candidate template ignored: invalid explicitly-specified argument for template parameter 'T': could not convert '3' from 'int' to class 'T' (expected a class, but got '3')}}
----------------
Endilll wrote:
The newly added diagnostic wording seems confusing to me, but the text in parentheses might be salvageable:
```suggestion
// expected-note@#cwg241-C-f {{candidate template ignored: invalid explicitly-specified argument for template parameter 'T': expected a type, but got value '3' (of type 'int'))}}
```
https://github.com/llvm/llvm-project/pull/122754
More information about the cfe-commits
mailing list