struct Layers { typedef struct Widgets { } Widgets; virtual void fun(void) { struct Widgets w; } Widgets w, x, y, z ; }; int main() { }
Standard input is empty
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; ^
Standard output is empty