<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/58352>58352</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang fails to match template argument of type given by another template argument
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
yurivict
</td>
</tr>
</table>
<pre>
Clang fails on this code:
```
template<typename T, T maxT>
T nnn() {
return 0;
}
void x() {
nnn<float, 1.f>();
}
```
error:
```
testcase.cpp:8:2: error: no matching function for call to 'nnn'
nnn<float, 1.f>();
^~~~~~~~~~~~~~~
testcase.cpp:3:3: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'maxT'
T nnn() {
^
1 error generated.
```
clang versions 14, 15, 16 fail.
gcc-11 succeeds.
FreeBSD 13.1
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVU9ty2yAQ_Rr0shONELrYD3pw7OQH6h9AsJLoYNAA8sR_X4TlpJkmnVYDCLQX9pyz6q28dUfNzQgDV9qDNRAm5UFYiYQdSHEixYE0xTbSMeBl1jxE-zHcZjT8gnAm5RHOcOFvZ8Je7n5nMMaQckfKPZD2-f4RtsdhWJyBgrDNQNrTtknr1SoJb99Fr4nZcdCWh_Vimg_rrcn5i4Sfy7-v6Jx13yP0QXCPuZjn6LOLs4wTHkFgbIQaxKRW4hYjgorEDdaB4FpDsEDKNoFv_7_uhy-pX0j7z-Orutk2Y7mrWodYnZFKRungoSGo0ViHcrUqc-U6so5vs1ZCBX178jMKNSiUwN24XNCEhPI9euYuqh_QrYCT-A_E34i_gkpbeicTRjToYiqZ_0UskTr0is5Hnj3QKpFXp7VJnbtFj0I8UQp-EQJR-vz3JK8O8fnHCSjLaYYdbZq6LdmOFZnsmNyzPc9CBI2f_oewCf0B-Z0IO8Da_jCqKxrob8AjzRO6P12zxeluCmH2a8OVr3GMKkxLnwt7iQetr4_X0-zsTxSxO16V9wv6uKl3rC6zqds3UlDJkDeM7Rox9IWgTVXxtsGGYr3LNO9R-47Uz6Q-Zaori7KkBa2KumB1ke_LqsahlYhN3_R1RaoCLyt368W5dWPmulRDv4w-GrXywX8YufexWRAf-fkSJuu62-LUVYmQpXq7VOwvw2JCwA">