https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86521

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
The cast is ambiguous

To construct a 'base', we consider the two constructors

1) base(const base&);
2) base(base&&);

for each of them we could convert the argument by either

3) operator U () &&
4) operator U const& () const&

For #1 we want to convert to const base&.  For direct reference binding, #4 is
the only candidate, and it is viable.  For #2 we want to convert to base&&,
only #3 is a candidate for direct reference binding, and it is viable.

The two user-defined conversion sequences are not comparable because they use
different conversion operators, so the initialization is ambiguous.

Reply via email to