fork download
  1. struct Outer
  2. {
  3. struct Inner;
  4. Inner inner; // incomplete type
  5. };
  6.  
  7. struct Outer::Inner
  8. {
  9. };
  10.  
  11. template<typename T>
  12. struct OuterTempl
  13. {
  14. struct InnerTempl;
  15. InnerTempl inner; // OK
  16. };
  17.  
  18. template<typename T>
  19. struct OuterTempl<T>::InnerTempl
  20. {
  21. };
  22.  
  23. int main()
  24. {
  25. }
  26.  
  27.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:4:11: error: field ‘inner’ has incomplete type
     Inner inner;   // incomplete type
           ^
stdout
Standard output is empty