<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/82882>82882</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] value parameter const-qualification influences overload resolution
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
h-2
</td>
</tr>
</table>
<pre>
```cpp
#include <concepts>
template <typename T>
void foobar(T) {}
template <std::integral T>
void foobar(T const) {}
int main()
{
foobar(3);
}
```
**Expected behaviour:**
This code is well-formed; the second overload is chosen (because more constrained); the `const` is irrelevant.
GCC and MSVC show this behaviour.
**Actual behaviour:**
Clang rejects this code:
```
<source>:11:5: error: call to 'foobar' is ambiguous
11 | foobar(3);
| ^~~~~~
<source>:4:6: note: candidate function [with T = int]
4 | void foobar(T) {}
| ^
<source>:7:6: note: candidate function [with T = int]
7 | void foobar(T const) {}
| ^
1 error generated.
Compiler returned: 1
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVM2O8zYMfBrmQiSwJXttH3zIz6annrroXZaYWIUsufrJ9rv02QvZ2c0WzYc91DASA6SGMxxSIgR9tUQ91AeoTxuR4uh8P27ZZnDqRw8vxfrKeYbiBMUeGNdWmqQIgR-ls5LmGIC_3sPLb6RpNiIuKfHHTFZMhG-fSTenFV6cG4QH1r4B6xCaAzSnn2GEqIDvge-1jXT1wvwcDKWzIT6H1DbiJLQF1gLr7pHmsH48MHgO8sNH_APioxVfEYHl9_WvmWQkhQON4qZd8pntEvqa_DbqgNIpQh3wnYzZXpyfSAE_YBwJA0lnFbobeeOEyllydIEsAmsHkiIFwsl5WjV6oS2pletyPtu0iH8p8lntPRm6CRt3X1n8cjyisAp__e33I4bRvWPMvD6p7_6rby9jEuYbdUcj7BU9_UEyhhUza825T_vHj8ElLykbyfdlCXxfA98jee9yBZTCGIwOgTUf1jRZl5gGfU0uhbtviGWJ0BwxP89NXEKfOVC__p2fp0Qq4PuXXN66SCsNq7TKg3hJVkbtLEJ9eNdxxDcEfkJtI9SnR6FqKfTNjD8YQf36lEjzv4k0z4g8349_N-jBqVztwCtZ8iKSuk_H0U2zNuTRU0w-jyHfY_nU6I3quep4JzbUl03RNm3ddPVm7BvGWFe0TcNL6qr6ImvFL93Auqp6aVk7bHTPClYVjFVlVfGy3rGKVzXr6FLxthtUAVVBk9BmZ8xt2jl_3egQEvUta1u2MWIgE5abjTGZpxMYy5ec73P-dkjXAFVhdIjhgRB1NMt1uJ6oT3gTJhHOwouJIvm1gds_kzD6oqVYjND2YhJZSeGxvp6CMymHN8mbfoxxDsvmnIGdrzqOadhJNwE75-L3v-3sXd4gYOdFSwB2XuT8EwAA__-RU6QH">