Fighting Arduino's IDE smartness

I thought this is a well-known problem. Anyways here it goes a trivial test case (tested with IDE 1.0.1, 1.0.2 gave the same problem with a similar albeit more complex case):

struct Boton {
  int pin;
};

void Chequea(Boton &b) {
}

void setup() {
}

void loop() {
}

which gives:

arco.cpp:2:14: error: variable or field ‘Chequea’ declared void
arco.cpp:2:14: error: ‘Boton’ was not declared in this scope
arco.cpp:2:21: error: ‘b’ was not declared in this scope

For the time being, I solved this specific instance by making Chequea a method of Boton, but I'm pretty sure that the problem will appear again and again.