class Foo { public: explicit Foo() {} explicit Foo(Foo&) {} }; Foo d = Foo();
error: no matching function for call to \
You don't want to mark either of those constructors as explicit - the compiler needs to use both of them, particularly the copy constructor, implicitly. What are you trying to achieve by marking them explicit?