<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/113898>113898</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
CE when there is no implicit conversion while considering one of multiple functions from a overload set
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ddvamp
</td>
</tr>
</table>
<pre>
Consider an example:
```
#include <cassert>
struct S {
int x = 0;
operator int const && () { return static_cast<int &&>(x); }
};
bool foo(int &&) { return false; }
bool foo(int const &&) { return true; }
int main() {
assert(foo(S{})); // error: no viable conversion from 'S' to 'int'
return 0;
}
```
There is no implicit conversion from `S` to `int &&`, which means that the `foo(int const &&)` function should win, because
```
int const &&i1 = S{}; // well-formed
int &&i2 = S{}; // ill-formed
```
It looks like either an error occurs when defining `ICS` for `int &&` for ranking purposes, or for some reason the compiler decided that there is such an `ICS` and it is better than `ICS` for `int const &&`
Please correct me if I'm wrong
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEVE1v4zgM_TX0hWhhy4k_Dj60yQTobYHufSHLdKytLBkSnXT__UK2t00ysxggcBKTj-_xUZQMQZ8tUQP7V9gfEznz4HzTdRc5Tknrun-ag7NBd-RRWqRPOU6GIH-B9AjpCxTp9ln_ilxbZeaOEPKDkiGQZ8h_bNHlGdjPivEdoXxd3yBqy_iJkB8xhfz1NhvRTeQlO78kKWcDI4gCRIEgKhB1rIOeePYWA0vW6i8lA0N-iIA1NUoQ1SeIGvJXhPK4UZTHB7rWOYO9cyCqG_Q9SS9NoLs6D6hbkQ9Y9vM9dH1G1Ci1_e5o635zUFRr9fcYKY-xj7UVBHECcULy3nnIX9A6vGjZGooqLuSDdhZ770YEUb6DKJFd_KktgyjvnN4k3kzgS-T9lP8cyBPqEMn0OBmtNP9MV6TvUKQLXZHemFmkIA54HbQacCRpA_IgGXmgmPi_LsZa_WwVR4YwuNl0eI2OHbAlJedAv9T6WElnyzH7z8gbC69kzFPv_EjdN3QDiUfQhtEPkMd1WJ5vjMa5j4BGfxCS5mHbpTgzdErNPuB1IIsd9dpqe45GvB0W-3rnf_Jveeml_Yip0-wnFyhEI5xfQsGNhJ5kcHaxVblx0oY8dqR0R92X4esUw6yGqOebVNoONcdYS8zkI8D-WtTdlO77_sOQDJHde1KMI6Hu8Q1EOeLVO3tOuibv6ryWCTVZmadZts_qOhmaXdmXVZ3XFVFf7uRe9m29a7u2KNJWSikT3YhU7LJUVFmW51n93O6rQvUl9aKuMmol7FIapTbPxlzGZ-fPiQ5hpibL8qquEiNbMmG58oSwdMUlCkLEG9A3EfTUzucAu9TowOG7DGs21Bx-rPPi3yzCddDrIi73Z5yWs4Sux3E2rCdDXyc6rEsj0V3IGyc7DMTJ7E0zME8h3rfLiTtrHub2WbkRxCmq2r6eJu_-JsUgTksvAcRpa_bSiH8DAAD__xpswqM">