https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113064
--- Comment #11 from m.cencora at gmail dot com ---
This is surprising to say the least because apparently for following code
(where both conversion operators return same type) the compiler somehow
correctly chooses && qualified overload:
struct bar
{
bar() = default;
bar(const bar&);
bar(bar&&);
bar& operator=(const bar&);
bar& operator=(bar&&);
};
struct foo
{
operator bar() const &;
operator bar() &&;
};
void test()
{
bar a = foo{}; // ok
a = foo{};
foo f;
a = f; // ok
}
So why cannot it apply the same overload resolution, when conversion operators
return different type as in comment #4?
Do you think this qualifies for a defect report?