6.6.5.2 It is an error if the file mode is not inspection immediately prior to any use of get or read.
In other words, it is an error to perform input from a file which is not open for reading (i.e. the file is either not open or open for writing).
This error is reported if I/O checking is enabled.