I just come across this issue by hazard.
I have a digitalWrite(pin, value) statement where "pin" is a number and not a symbol. The number is out of the range for the real board (35 for an ATtiny of 8 pins), by mistake. At the compiling time is no error message for it.
I tried also with digitalRead and pinMode for Arduino Pro or Pro Mini, for Arduino Uno and for my target board with Attiny25/45/85. I tried on three computers with different versions of Windows. The same result: no error message for out of range concerning the "pin" number.
Is it normal behavior for the compiler? B.t.w. I tried only with the last version of Arduino IDE 1.8.5.