<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63744>63744</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Template function with constant reference fails to compile CLC++ with Clang 16 and 17
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
BukeBeyond
</td>
</tr>
</table>
<pre>
`clang -x cl -cl-std=CLC++ -target spir-unknown-unknown -S -emit-llvm --compile Bug.cl -o Bug.ll`
`error: definition with same mangled name '_Z1fIfEvRKT_' as another definition`
```
template<typename N> void f(const N& n) {} // Fails
// template<typename N> void f(N&& n) {} // OK
// template<typename N> void f(N n) {} // OK
// void f(const float& n) {} // OK
kernel void Kernel()
{
float n;
f(n + n);
f(n);
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUk1FvmzAQxz_N8XIiMoZgeOChJI00deqkrU97qQwcxKuxI9u067efcFKlqjR1kxA-n7nf-bj7S-_VZIga2Law3SdyCUfrmnZ5opZerRmSzg6vDZSs19JMmP7GXmPa69SHAfL97usOeAu8xTRIN1FAf1IuXcyTsS_mbcX0B6Y0q5Bq_TxjmvZ2PilN2C7TZuXZaGkNJQO2B3YDJSPnrIP8BgcalVFBWYMvKhzRy5lwlmbSNKBZN8DF489s_DLePn-_e3gELlB6lMaGI7l38Vf8W5LLE7eB5pOWgSDfhdcTRfI95Lf4bNWAI_Cqt8YHvAdeogFeI4gWxB6BH4Af8CCV9hfy2fM5cWX9Bfft7n9Z_0D5UMqorQyf5Y_vJ3KG9Dn-LtrAK-D15RvRng08I9FAfvUArwyuM7JmuR5E_3sPiP2HxiRDkw91XsuEmqysKlHUZSWSY8NKXmUdqzouMp51I6vrLQ1FURciK_ggE9VwxnMmmMgEq1i2kVL02XYrirJjvdgOUDCapdKbdSQ31k2J8n6hpsxFUSRadqR9VAXnhl4wHgLnq0hcs8ak3TJ5KJhWPvgrJaigqXm4dAvHxfTX0Y1_XZqAjkZyZHrCcZ0aDBbfNHGVVAzZRd1lJUozYCaSxenmGMLJQ35p6qTCcek2vZ2BH9Z7XJb05Owv6gPwQ7y9B36I1f0JAAD__2biKks">