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

            Bug ID: 96161
           Summary: istream::ignore sets eofbit too soon
           Product: gcc
           Version: 10.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

#include <sstream>
#include <iostream>
int main()
{
  std::istringstream s("++");
  s.ignore(2, '-');
  std::cout << "EOF? " << s.eof() << std::endl;
}

This shows that we set eofbit when the end of the stream is reached, even
though we have already discarded as many characters as requested.

Libc++ and MSVC do not set eofbit here.

Reply via email to