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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #1)
>     MoveOnly(MoveOnly&) =delete;

This is not caused by the faxct it's move-only, but by the unconventional
non-const parameter on the deleted copy constructor. If it's a const reference
then move-only types work as expected (and as widely tested in the testsuite!)

I'm tempted to call it a core defect that the defaulted copy constructor
doesn't just get deleted here:

struct MoveOnly
{
    MoveOnly(MoveOnly&) =delete;
    MoveOnly(MoveOnly&& ){}
    MoveOnly(){}
};

struct D : MoveOnly {
  D(const D&) = default;
  D(D&&) = default;
  D() = default;
};

The base class has a deleted copy ctor, so who cares that the derived class
defaults it with a different signature, it should just delete it in the derived
class too. However, 12.8 [class.copy] p11 (11.2) doesn't apply here.

Reply via email to