fork(8) download
  1. struct Layers
  2. {
  3. typedef struct Widgets { } Widgets;
  4.  
  5. virtual void fun(void)
  6. {
  7. struct Widgets w;
  8. }
  9.  
  10. Widgets w, x, y, z ;
  11. };
  12.  
  13. int main() { }
Compilation error #stdin compilation error #stdout 0s 3292KB
stdin
Standard input is empty
compilation info
prog.cpp: In member function ‘virtual void Layers::fun()’:
prog.cpp:7:16: error: using typedef-name ‘Layers::Widgets’ after ‘struct’
         struct Widgets w;
                ^
prog.cpp:3:32: note: ‘Layers::Widgets’ has a previous declaration here
     typedef struct Widgets { } Widgets;
                                ^
prog.cpp:7:25: error: invalid type in declaration before ‘;’ token
         struct Widgets w;
                         ^
prog.cpp:7:24: warning: unused variable ‘w’ [-Wunused-variable]
         struct Widgets w;
                        ^
stdout
Standard output is empty