This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/81380] New: basic_stringbuf::seekoff doesn't fail when trying to reposition a null sequence


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

            Bug ID: 81380
           Summary: basic_stringbuf::seekoff doesn't fail when trying to
                    reposition a null sequence
           Product: gcc
           Version: 8.0
            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 <cassert>

int main()
{
  std::stringbuf sb("foo", std::ios::in);
  assert(sb.pubseekoff(1, std::ios::beg) == -1);
  assert(sb.pubseekpos(1) == -1);
}

The second assertion should be equivalent to the first ([stringbuf.virtuals]
p13) but it fails:

seekpos: seekpos.cc:8: int main(): Assertion `sb.pubseekpos(1) == -1' failed.
Aborted (core dumped)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]