Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.1.2, 4.1.3
-
None
-
all
Description
The istream::sentry ctor is not supposed to change gcount(). Ours does.
$ cat z.cpp && make z && ./z
#include <cassert>
#include <sstream>
int main ()
{
std::istringstream strm (" ");
const std::istream::sentry sentry (strm);
assert ((strm.eofbit | strm.failbit) == strm.rdstate ());
assert (0 == strm.gcount ());
}
gcc -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG -D_RWSTD_USE_CONFIG -I/build/sebor/dev/stdlib/include -I/build/sebor/gcc-4.1.0-11s/include -I/build/sebor/dev/stdlib/../rwtest -I/build/sebor/dev/stdlib/../rwtest/include -I/build/sebor/dev/stdlib/tests/include -pedantic -nostdinc++ -g -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long z.cpp
gcc z.o -o z -L/build/sebor/gcc-4.1.0-11s/rwtest -lrwtest11s -L/build/sebor/gcc-4.1.0-11s/lib -lstd11s -lsupc++ -lm
Assertion failed: 0 == strm.gcount (), file z.cpp, line 9
Abort (core dumped)
Attachments
Issue Links
- blocks
-
STDCXX-230 arithmetic extractors affect gcount()
- Closed