Yes, this is the correct behaviour since C++11.
- istream behavior change in C++ upon failure
The difference in what you're seeing is that a zero is written "when extraction fails", but extraction is not even attempted if EOF is already set on the stream… so nothing happens.