If you have a user-declared (manual declaration) copy of ctor, the ctor will not be declared implicitly. Just leave the ctor move, and it will not take part in overload resolution (i.e. it will not indicate it as deleted, just leave the whole announcement).
CWG DR 1402 : ctor , ctor, . , ctor . . ctor, " , ". , ctor ( ), , ctor ( , ).
#include <iostream>
struct loud
{
loud() { std::cout << "default ctor\n"; }
loud(loud const&) { std::cout << "copy ctor\n"; }
loud(loud&&) { std::cout << "move ctor\n"; }
~loud() { std::cout << "dtor\n"; }
};
struct foo
{
loud l;
foo() = default;
foo(foo const& p) : l(p.l) { };
};
foo make_foo()
{
return {{}};
}
int main()
{
auto x = make_foo();
}
(, -fno-elide-constructors). :
default ctor
copy ctor
dtor
dtor