compiler error that depends upon the location of a typedef...

An alternative fix: Put in your own function prototype, after the type declaration and before the function declaration. That will prevent the IDE from generating a prototype for you.

bool testfunc(SensorData &_data);
bool testfunc(SensorData &_data) {

}

It's not beautiful but it allows you to keep the typedef and function declaration where they are.