class Foo { public: explicit Foo() {} explicit Foo(Foo&) {} }; Foo d = Foo();
error: no matching function for call to \
Foo d = Foo();
should be
Foo d;
The first line creates a Foo instance and then copies it to d;