stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Created: (STDCXX-295) [LWG issue 453] basic_stringbuf::seekoff need not always fail for an empty stream
Date Thu, 05 Oct 2006 19:48:23 GMT
[LWG issue 453] basic_stringbuf::seekoff need not always fail for an empty stream
---------------------------------------------------------------------------------

                 Key: STDCXX-295
                 URL: http://issues.apache.org/jira/browse/STDCXX-295
             Project: C++ Standard Library
          Issue Type: Bug
          Components: 27. Input/Output
    Affects Versions: 4.1.2, 4.1.3
         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.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message