fork download
  1. class CL1 { public: CL1(int) {} };
  2. class CL2 : private virtual CL1{ public: CL2() : CL1(42) {} };
  3. class CL3 : private virtual CL1{ public: CL3() : CL1(42) {} };
  4.  
  5. class CL4 : public CL2, public CL3
  6. {
  7. public:
  8. CL4() : CL2(), CL3(){}
  9. };
  10.  
  11. int main()
  12. {
  13. CL4 cl4;
  14. return 0;
  15. }
  16.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In constructor ‘CL4::CL4()’:
prog.cpp:8:24: error: no matching function for call to ‘CL1::CL1()’
     CL4() : CL2(), CL3(){}
                        ^
prog.cpp:8:24: note: candidates are:
prog.cpp:1:21: note: CL1::CL1(int)
 class CL1 { public: CL1(int) {} };
                     ^
prog.cpp:1:21: note:   candidate expects 1 argument, 0 provided
prog.cpp:1:7: note: CL1::CL1(const CL1&)
 class CL1 { public: CL1(int) {} };
       ^
prog.cpp:1:7: note:   candidate expects 1 argument, 0 provided
stdout
Standard output is empty