<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60113>60113</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Fail to select more specialized function template in case of auto non-type template parameter
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Fedr
</td>
</tr>
</table>
<pre>
In the following code
```
template<int N> struct A{};
template<auto N> void g(A<N>);
template<int N> void g(A<N>) {}
int main() {
g( A<1>{} );
}
```
Clang complains that `call to 'g' is ambiguous` , but GCC selects the more specialized function template `<int N>`, which seems the correct behavior. Online demo: https://gcc.godbolt.org/z/hff8KcGjj
Related discussion: https://stackoverflow.com/a/75147620/7325599
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMk9FuqzgQhp9muBk1MuMA4YKLNF2q1Uq70r6BMQO4a-wIm0Tt069M09Ocnl4cCQls5pt__hlbhWBGx9xA8QjFU6bWOPmlablfss73r82fDuPEOHhr_dW4EbXvGcQTiCOU4vZsy8jz2arIIE_GRfwb5B8Y4rLqiEeoHqF6Avl4I78Cao3-nUDEizc9jkCHI8hT2gSqf6DfqXwH4E3yTi_Fz8o4oMNHwLafNBONCc8TvqF4L_uZ6mfTJ6u2nqSijAsYJxURSqGVtRg9AlUjUIUmoJo7M65-DVAKBDpht0Z8Pp0wsGUdw9bn2S-M4czaKGveuMdhdToa7_DDeMp-Zz6t6ITXyegJA_P8nkf7ZWEdseNJXYxfdviPs8Yx9jx7kEecYjwHkEegFqgdtd6Nvu-8jTu_jEDtG1A7DcPhL_388nLfxX85VdFjb4JeQzDe_ZouRKX_8xdeBuuvO-1noFYBtVWR76uSRPqUVBR1nfWN7GtZq4ybvKz2gsp9ccimRhQ59cOh6qUu-pIqVed1TZILLmuSNGSmIUFS5PlBVCSKw64c6jzvikEyE1fFAHvBszJ2Z-1lTq4yE8LKTSnyXGZWdWzDduyJHF9x-wlE6RYsTWIeunUMsBfWhBg-s0QTLTetMtuA34f3O3MzDrUKjH7A7bg77x7i65k_I85qUTNHXrJ1sc2XCZk4rd2tl6mW2-vhvPgX1hGo3RwEoHZz-H8AAAD__-QlLDc">