[
https://issues.apache.org/jira/browse/STDCXX-295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Martin Sebor updated STDCXX-295:
--------------------------------
Summary: [LWG #453] basic_stringbuf::seekoff need not always fail for an
empty stream (was: [LWG issue 453] basic_stringbuf::seekoff need not always
fail for an empty stream)
> [LWG #453] basic_stringbuf::seekoff need not always fail for an empty stream
> ----------------------------------------------------------------------------
>
> Key: STDCXX-295
> URL: https://issues.apache.org/jira/browse/STDCXX-295
> Project: C++ Standard Library
> Issue Type: Bug
> Components: 27. Input/Output
> Affects Versions: 4.1.3, 4.1.2
> Environment: all
> Reporter: Martin Sebor
>
> According to DR 453, the program below should run successfully to completion:
> $ cat u.cpp && make u && ./u
> #include <cassert>
> #include <sstream>
> int main()
> {
> std::istringstream in;
> std::ostringstream out;
> std::stringstream inout;
> // DR453:
> // http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#453
> //
> // changes 27.7.1.3, p10 (seekoff, called by tellg() and tellp())
> // to read:
> //
> // For a sequence to be positioned, if its next pointer (either
> // gptr() or pptr()) is a null pointer and the new offset newoff
> // is nonzero, the positioning operation fails.
> assert (0 == in.tellg ());
> assert (0 == out.tellp ());
> assert (0 == inout.tellg ());
> assert (0 == inout.tellp ());
> }
> 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/examples/include -pedantic -nostdinc++ -g -W
> -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long u.cpp
> gcc u.o -o u -L/build/sebor/gcc-4.1.0-11s/lib -lstd11s -lsupc++ -lm
> Assertion failed: 0 == in.tellg (), file u.cpp, line 20
> Abort (core dumped)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.