Do ideal comparators swing between their power rails (-5V to 5V) in this case, or does the output only swing between 0V < V_out < 5V?
If the output can swing from -5V to 5V, that would mean this circuit would have to accept input from -5V to 5V. Can ideal comparators handle -5V input? I was looking at the LM339 spec sheet and it looks like it can only handle input from -0.3V < V_in < V_supply - 1.5V
Ideal devices have no limitations so it's of little practical use to discuss their capabilities.
The LM339 can only handle an input common-mode range from -0.3V < V_in < V_supply - 1.5V as you stated. Most real comparators will only work if their input voltage is less then the supply rails, so that's not unusual.