fork download
  1. class Base { };
  2.  
  3. class Derived;
  4.  
  5. Base* foo() { return new Derived(); }
  6.  
  7. int main()
  8. {
  9. return 0;
  10. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘Base* foo()’:
prog.cpp:5:34: error: invalid use of incomplete type ‘class Derived’
prog.cpp:3:7: error: forward declaration of ‘class Derived’
prog.cpp:5:37: warning: control reaches end of non-void function [-Wreturn-type]
stdout
Standard output is empty