C++ auto-generated copy constructors with const and non-const refs -
consider following code snippet: #include <iostream> struct foo { foo() = default; foo(foo &) { std::cout << "foo(foo &)" << std::endl; } }; struct bar { foo m; }; int main() { bar b; bar b2(b); } if code run, foo(foo &) message written. ok, foo doesn't have foo(const foo &) constructor, base(base &) constructor generated base . now, if add following definition of foo : foo(const foo &) { std::cout << "foo(const foo &)" << std::endl; } the foo(const foo &) message written. ok, foo has copy-constructor const ref parameter, base(const base &) generated compiler. but, if declare foo(const foo &) explicitly deleted: foo(const foo&) = delete; then program won't compile following errors: prog.cc: in function 'int main()': prog.cc:15:13: error: use of deleted function 'bar::bar(const bar&)' bar b2(b); ...