https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71431
--- Comment #8 from Dima Tisnek <dimaqq at gmail dot com> ---
Looks like I cannot distinguish between a directory and an empty file:
```
buf << expression.rdbuf();
/* check buf.rdstate() */
```
underlying file name was a directory -- rdstate() == 4
underlying file name is empty file -- rdstate() == 4
It's good enough for me (file shouldn't be empty), but may be a gotcha for
someone else.
Personally I find it weird that nothing is set on `expression`, but hey, I
didn't read the standard, did I?