[Bug libstdc++/81380] New: basic_stringbuf::seekoff doesn't fail when trying to reposition a null sequence
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jul 10 13:59:00 GMT 2017
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)
More information about the Gcc-bugs
mailing list