class Base { }; class Derived; Base* foo() { return new Derived(); } int main() { return 0; }
Standard input is empty
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]
Standard output is empty