What do you mean by "invalid" IntRect?
You shouldn't return by const reference when you're not always referencing an persisting object.
Your referenced object has to alive as long as the reference exists.
In case getEmpty() is true, then IntRect() will create a temporary object, which you then reference, but since the temp object gets destroyed at the end of the function, the referenced object is destroyed and you basically have undefined behavior.