https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111145

            Bug ID: 111145
           Summary: istream::operator>>(streambuf*) does not set gcount
           Product: gcc
           Version: 13.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: admin at computerquip dot com
  Target Milestone: ---

Example code: https://godbolt.org/z/cW9Pe1c85
```
#include <sstream>
#include <iostream>

int main()
{
    std::ostringstream oss;
    std::istringstream iss("test");

    iss >> oss.rdbuf();

    std::cout << "gcount is " << iss.gcount() << "\n";
}
```

Here I'm expecting `iss.gcount()` to return 4 as `iss >> oss.rdbuf();`, as far
as I can tell, fits under the conditions that should set the value accessed by
gcount().

As per the godbolt link, it instead returns 0.

Reply via email to