fork(3) download
  1. class CBase
  2. {
  3. public:
  4. CBase(char *pszArg1, char *pszArg2, char *pszArg3) {}
  5. virtual ~CBase() {}
  6. };
  7.  
  8. class CDerived : CBase
  9. {
  10. public:
  11. using CBase::CBase;
  12. };
  13.  
  14. int main()
  15. {
  16. CDerived d("1", "2", "3");
  17. return 0;
  18. }
  19.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:11:15: error: using declaration cannot refer to a constructor
        using CBase::CBase;
              ~~~~~~~^
prog.cpp:16:11: error: no matching constructor for initialization of 'CDerived'
        CDerived d("1", "2", "3");
                 ^ ~~~~~~~~~~~~~
prog.cpp:8:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 3 were provided
class CDerived : CBase
      ^
prog.cpp:8:7: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 3 were provided
2 errors generated.
stdout
Standard output is empty