fork download
  1. struct X;
  2.  
  3. struct T
  4. {
  5. T() { w = new X(); }
  6.  
  7. X *w;
  8.  
  9. };
  10.  
  11. struct X {
  12.  
  13. X() { }
  14.  
  15. T x;
  16. };
  17.  
  18. int main()
  19. {
  20.  
  21. }
  22.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In constructor 'T::T()':
prog.cpp:5:21: error: invalid use of incomplete type 'struct X'
     T() { w = new X(); }
                     ^
prog.cpp:1:8: note: forward declaration of 'struct X'
 struct X;
        ^
stdout
Standard output is empty