https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92662
--- Comment #6 from Michael Matz <matz at gcc dot gnu.org> --- (In reply to Jonathan Wakely from comment #5) > > Before choosing which conversion operator to use, the compiler considers the > constructors of S, finding S(const S&) and S(S&&) as candidates. There is a > viable conversion from Test&& to const S& and also one from Test&& to S&&. > Both of those conversion sequences have conversion rank "user-defined" > (because they use a user-defined conversion operator) but they use different > conversion operators. Two different user-defined conversions are ambiguous, Ah, it makes sense now ... > it doesn't matter that one is a better match for being called on an rvalue. ... except may be this should matter ;-) But it is as it is. > The moveme(t).str() case is different, because there's no user-defined > conversion. Overload resolution chooses which str() to call, and that *does* > consider the ref-qualifiers when deciding which str() is a better match. Right overload resolution vs. UCS, okay got it, many thanks :)