++
Assignee: unassigned at gcc dot gnu.org
Reporter: dimaqq at gmail dot com
Target Milestone: ---
Pardon my primitive code:
```
auto utf8 = std::locale(std::locale(), new std::codecvt_utf8);
std::wifstream expression(argv[1]);
if (!expression) { /* ... */ return 99
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71431
Dima Tisnek changed:
What|Removed |Added
Status|RESOLVED|NEW
Resolution|INVALID
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71431
--- Comment #6 from Dima Tisnek ---
Perhaps in my case, it's a combination of directory, `imbue` and `rdbuf` ?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71431
--- Comment #7 from Dima Tisnek ---
Ugh, it never occurred to me to check error on target of buffer copy.
`buf.rdstate()` does report an error for me.
A bit unexpected and seems like black magic, but the error is there :)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71431
--- Comment #8 from Dima Tisnek ---
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 fi