> struct func(); // prototype
You want the name of the struct as well
struct test func(); // prototype

Or since this is c++, you can simply do
test func(); // prototype

Don't forget to fix the actual function as well