// Base has no default constructor class Base { public: Base(int y) : y(y) { } int y; }; // Compiler error when you try to instantiate a D1, as D1’s // synthesized default constructor needs to invoke Base's default // constructor. class Der1 : public Base { public: int z; }; // Works. class Der2 : public Base { public: Der2(int y, int z) : Base(y), z(z) { } int z; }; int main(int argc, char **argv) { Base b(1); // OK Der2 d2(1, 2); // OK // Der1 d1; // compiler error return 0; }