stdcxx-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Farid Zaripov (JIRA)" <j...@apache.org>
Subject [jira] Created: (STDCXX-795) std::basic_stringbuf::overflow() writes characters at the begin, but not at the current position if reallocation of internal buffer occurs
Date Tue, 25 Mar 2008 14:25:24 GMT
std::basic_stringbuf::overflow() writes characters at the begin, but not at the current position
if reallocation of internal buffer occurs
------------------------------------------------------------------------------------------------------------------------------------------

                 Key: STDCXX-795
                 URL: https://issues.apache.org/jira/browse/STDCXX-795
             Project: C++ Standard Library
          Issue Type: Bug
          Components: 27. Input/Output
    Affects Versions: 4.2.0
         Environment: All
            Reporter: Farid Zaripov
            Assignee: Farid Zaripov
             Fix For: 4.2.1


>From [http://www.mail-archive.com/user@stdcxx.apache.org/msg00014.html]

The test below asserts on i = 513
{code:title=test.cpp}
#include <sstream>
#include <string>
#include <cassert>

int main ()
{
    std::ostringstream strm;
    std::string s;

    for (size_t i = 1; i <= 1024; ++i) {
        const char c = char (i);
        strm << c;
        s.push_back (c);
        assert (strm.str () == s);
    }

    return 0;
}
{code}

The test output:
{noformat}
test: test.cpp:14: int main (): Assertion `strm.str () == s' failed.
Aborted
{noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message