You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Farid Zaripov (JIRA)" <ji...@apache.org> on 2007/10/09 15:15:51 UTC
[jira] Reopened: (STDCXX-206) std::operator<<(ostream, string)
doesn't call width(0) on ios_base::failure
[ https://issues.apache.org/jira/browse/STDCXX-206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Farid Zaripov reopened STDCXX-206:
----------------------------------
> std::operator<<(ostream, string) doesn't call width(0) on ios_base::failure
> ---------------------------------------------------------------------------
>
> Key: STDCXX-206
> URL: https://issues.apache.org/jira/browse/STDCXX-206
> Project: C++ Standard Library
> Issue Type: Bug
> Components: 21. Strings
> Affects Versions: 4.1.3
> Environment: all
> Reporter: Anton Pevtsov
> Assignee: Martin Sebor
> Priority: Minor
> Fix For: 4.2
>
>
> The following test fails:
> #include <iostream>
> #include <strstream>
> #include <string>
> #include <cassert>
> int main(int argc, char* argv[])
> {
> std::string str ("abcdefghijk");
> char buf[10];
> std::ostrstream os (buf, sizeof(buf));
> const std::streamsize width = 2;
> os.width (width);
> os.exceptions (std::ios_base::failbit | std::ios_base::badbit);
> try {
> os << str;
> }
> catch (std::ios_base::failure&) {
> }
> assert (0 == os.width ());
> return 0;
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.