<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/71332>71332</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Declaring by value parameter `const` makes clang complain about ambiguity despite constraint
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
davidstone
</td>
</tr>
</table>
<pre>
The following valid code:
```cpp
template<typename T> requires true
bool f(T const);
template<typename T>
bool f(T);
bool b = f(0);
```
causes clang to give an error of:
```shell
<source>:6:10: error: call to 'f' is ambiguous
6 | bool b = f(0);
| ^
<source>:2:6: note: candidate function [with T = int]
2 | bool f(T const);
| ^
<source>:4:6: note: candidate function [with T = int]
4 | bool f(T);
| ^
1 error generated.
Compiler returned: 1
```
See it live: https://godbolt.org/z/4vbhcGMca
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykk8tymzwUx59GbM7EgwQYWLBw7Phbfav6BYR0ALVCoro44z59R9iJ00zjTTUew4hz-Z3Ln3uvRoPYkeqZVIeMxzBZ10l-VtIHazDrrbx0pwlhsFrbV2VGOHOtJAgrkRQ7kh9I_va_za8_sSzXm4DzonlAUuzDZUHDZ4QTKV7A4c-oHHoILuLVtrdWw0BYcwJhjQ-EtaR4fhzns-dHnw_feiDFYbXI_7B44_3oIHj06EFobkYIFkZ1RuAG0DnrwA5f1ewn1Pp2V-y9jU5gIix2W1LsaE6K3TVGehFc6xScsHogrAblgc-9GqON_hoDtkDqPTzCh_Ukq_dDqpe_IrAbBhibmpgAjFSSB4QhGhGUNUCq51cVJjit2ZQJpDrcE7E7zhczuuN8RVH-M0X5ieJBO94h6G10Ixp0PKDcXO_3dl6URgcOQ3QGZSKiDzbjGyKoAFqdV_gphMWnbWBHwo6jlb3VYWPdSNjxF2HH8txP4r__Bc9kV8i2aHmGHd22LaNNTZts6vK6500jqoIOvOd5SXFotrLkpeSyxbrMVMdyVlCaV4xSWjWbvmnrdhjKig3tMFBKyhxnrvRG6_OccmfK-4hdTYuCZZr3qP2qbcbWhSaMJZm7Ltk_9XH0pMy18sHfIwQVNHYHFJq7JPf-khQfERbu-IwBHSSJr-Pf5jDzH-9yETbJVBngvY3httIqXECiX1TA69I4rkzIotPdpxaqMMV-I-xM2DHh3B5Pi7PfUQTCjmt1nrDjWuDvAAAA__8uS2Gd">