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