Issue 113898
Summary CE when there is no implicit conversion while considering one of multiple functions from a overload set
Labels new issue
Assignees
Reporter ddvamp
    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
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to