https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90936
Bug ID: 90936 Summary: [9 Regression] Ambiguous call with ref-qualified conversion operators Product: gcc Version: 9.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: m.cencora at gmail dot com Target Milestone: --- gcc 9 and trunk complains about ambiguous call when constructing or assigning to f2. This works fine with gcc 8 or earlier. struct Foo {}; struct ConvertibleToFoo { operator const Foo&() const &; operator Foo&&() &&; }; void bar() { Foo f1(static_cast<const ConvertibleToFoo&>(ConvertibleToFoo{})); Foo f2(static_cast<ConvertibleToFoo&&>(ConvertibleToFoo{})); f1 = static_cast<const ConvertibleToFoo&>(ConvertibleToFoo{}); f2 = static_cast<ConvertibleToFoo&&>(ConvertibleToFoo{}); }