You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Anton Pevtsov (JIRA)" <ji...@apache.org> on 2006/06/22 16:26:29 UTC

[jira] Created: (STDCXX-206) lib.string.io operator << doesn't call width (0) if ios_base::failure exception occurred

lib.string.io operator <<  doesn't call width (0) if  ios_base::failure exception occurred
------------------------------------------------------------------------------------------

         Key: STDCXX-206
         URL: http://issues.apache.org/jira/browse/STDCXX-206
     Project: C++ Standard Library
        Type: Bug

  Components: 21. Strings  
    Versions: 4.1.3    
 Environment: all
    Reporter: Anton Pevtsov
 Assigned to: Anton Pevtsov 
    Priority: Minor


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.
-
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


[jira] Issue Comment Edited: (STDCXX-206) std::operator<<(ostream, string) doesn't call width(0) on ios_base::failure

Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12534104 ] 

farid edited comment on STDCXX-206 at 10/11/07 10:58 AM:
-----------------------------------------------------------------

The test doesn't fails, but should :)

By default the _RWSTD_NO_EXT_KEEP_WIDTH_ON_FAILURE macro is not defined and this means (as I understand) that width() should be preserved in case of the failure.

And the regression test should consider this macro, like does the 21.string.io.cpp test.

I suggest to change the regression test in this way:

#ifndef _RWSTD_NO_EXT_KEEP_WIDTH_ON_FAILURE
    assert (width == os.width ());
#else
    assert (0 == os.width ());
#endif


      was (Author: farid):
    The test doesn't fails, but should :)

By default the _RWSTD_NO_EXT_KEEP_WIDTH_ON_FAILURE macro is not defined and this means (as I understand) that width() should be preserved in case of the failure.

And the regression test should consider this macro, line does the 21.string.io.cpp test.

I suggest to change the regression test in this way:

#ifndef _RWSTD_NO_EXT_KEEP_WIDTH_ON_FAILURE
    assert (width == os.width ());
#else
    assert (0 == os.width ());
#endif

  
> 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.


[jira] Reopened: (STDCXX-206) std::operator<<(ostream, string) doesn't call width(0) on ios_base::failure

Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
     [ 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.


[jira] Resolved: (STDCXX-206) std::operator<<(ostream, string) doesn't call width(0) on ios_base::failure

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/STDCXX-206?page=all ]
     
Martin Sebor resolved STDCXX-206:
---------------------------------

    Fix Version: 4.2
     Resolution: Fixed

Fixed by the referenced patch and tested in http://svn.apache.org/repos/asf/incubator/stdcxx/trunk/tests/strings/21.string.io.cpp.

> std::operator<<(ostream, string) doesn't call width(0) on ios_base::failure
> ---------------------------------------------------------------------------
>
>          Key: STDCXX-206
>          URL: http://issues.apache.org/jira/browse/STDCXX-206
>      Project: C++ Standard Library
>         Type: Bug

>   Components: 21. Strings
>     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.
-
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


[jira] Assigned: (STDCXX-206) lib.string.io operator << doesn't call width (0) if ios_base::failure exception occurred

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/STDCXX-206?page=all ]

Martin Sebor reassigned STDCXX-206:
-----------------------------------

    Assign To: Martin Sebor  (was: Anton Pevtsov)

> lib.string.io operator <<  doesn't call width (0) if  ios_base::failure exception occurred
> ------------------------------------------------------------------------------------------
>
>          Key: STDCXX-206
>          URL: http://issues.apache.org/jira/browse/STDCXX-206
>      Project: C++ Standard Library
>         Type: Bug

>   Components: 21. Strings
>     Versions: 4.1.3
>  Environment: all
>     Reporter: Anton Pevtsov
>     Assignee: Martin Sebor
>     Priority: Minor

>
> 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.
-
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


[jira] Closed: (STDCXX-206) std::operator<<(ostream, string) doesn't call width(0) on ios_base::failure

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/STDCXX-206?page=all ]
     
Martin Sebor closed STDCXX-206:
-------------------------------


> std::operator<<(ostream, string) doesn't call width(0) on ios_base::failure
> ---------------------------------------------------------------------------
>
>          Key: STDCXX-206
>          URL: http://issues.apache.org/jira/browse/STDCXX-206
>      Project: C++ Standard Library
>         Type: Bug

>   Components: 21. Strings
>     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.
-
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


[jira] Commented: (STDCXX-206) std::operator<<(ostream, string) doesn't call width(0) on ios_base::failure

Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12533360 ] 

Farid Zaripov commented on STDCXX-206:
--------------------------------------

I think that in r420970 should be used #ifdef instead of #ifndef (from changelog: When the macro is not #defined, reset width only after all characters, including any padding, have been successfully output (for consistency with numeric inserters)).

The patch below:

Index: _ioinsert.cc
===================================================================
--- _ioinsert.cc	(revision 582748)
+++ _ioinsert.cc	(working copy)
@@ -170,7 +170,7 @@
             else {
                 __err = _STD::ios_base::badbit;
 
-#ifndef _RWSTD_NO_EXT_KEEP_WIDTH_ON_FAILURE
+#ifdef _RWSTD_NO_EXT_KEEP_WIDTH_ON_FAILURE
                 __strm.width (0);
 #endif   // _RWSTD_NO_EXT_KEEP_WIDTH_ON_FAILURE
             }


> 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.


[jira] Commented: (STDCXX-206) std::operator<<(ostream, string) doesn't call width(0) on ios_base::failure

Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12534104 ] 

Farid Zaripov commented on STDCXX-206:
--------------------------------------

The test doesn't fails, but should :)

By default the _RWSTD_NO_EXT_KEEP_WIDTH_ON_FAILURE macro is not defined and this means (as I understand) that width() should be preserved in case of the failure.

And the regression test should consider this macro, line does the 21.string.io.cpp test.

I suggest to change the regression test in this way:

#ifndef _RWSTD_NO_EXT_KEEP_WIDTH_ON_FAILURE
    assert (width == os.width ());
#else
    assert (0 == os.width ());
#endif


> 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.


[jira] Assigned: (STDCXX-206) std::operator<<(ostream, string) doesn't call width(0) on ios_base::failure

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Sebor reassigned STDCXX-206:
-----------------------------------

    Assignee: Farid Zaripov  (was: Martin Sebor)

Okay, sounds like you have a better understanding of the issue at me. Could you make the necessary corrections to both the regression test and the library? Thanks!

> 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: Farid Zaripov
>            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.


[jira] Updated: (STDCXX-206) std::operator<<(ostream, string) doesn't call width(0) on ios_base::failure

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/STDCXX-206?page=all ]

Martin Sebor updated STDCXX-206:
--------------------------------

    Summary: std::operator<<(ostream, string) doesn't call width(0) on ios_base::failure  (was: lib.string.io operator <<  doesn't call width (0) if  ios_base::failure exception occurred)

> std::operator<<(ostream, string) doesn't call width(0) on ios_base::failure
> ---------------------------------------------------------------------------
>
>          Key: STDCXX-206
>          URL: http://issues.apache.org/jira/browse/STDCXX-206
>      Project: C++ Standard Library
>         Type: Bug

>   Components: 21. Strings
>     Versions: 4.1.3
>  Environment: all
>     Reporter: Anton Pevtsov
>     Assignee: Martin Sebor
>     Priority: Minor

>
> 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.
-
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


[jira] Resolved: (STDCXX-206) std::operator<<(ostream, string) doesn't call width(0) on ios_base::failure

Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Farid Zaripov resolved STDCXX-206.
----------------------------------

    Resolution: Fixed

Fixed thus: http://svn.apache.org/viewvc?rev=584801&view=rev

Merged into 4.2.0 branch thus: http://svn.apache.org/viewvc?rev=584805&view=rev

> 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: Farid Zaripov
>            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.


[jira] Commented: (STDCXX-206) std::operator<<(ostream, string) doesn't call width(0) on ios_base::failure

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12533920 ] 

Martin Sebor commented on STDCXX-206:
-------------------------------------

The originally submitted test case doesn't fail for me with gcc 3.4.6 on Linux (I just added it to our regression test suite). Does it fail for you? If not, do you have one showing that there is a problem?

> 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.


[jira] Closed: (STDCXX-206) std::operator<<(ostream, string) doesn't call width(0) on ios_base::failure

Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Farid Zaripov closed 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: Farid Zaripov
>            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.


[jira] Commented: (STDCXX-206) lib.string.io operator << doesn't call width (0) if ios_base::failure exception occurred

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/STDCXX-206?page=comments#action_12417554 ] 

Martin Sebor commented on STDCXX-206:
-------------------------------------

See the following posts for background:
http://mail-archives.apache.org/mod_mbox/incubator-stdcxx-dev/200606.mbox/%3c4499F98E.60505@roguewave.com%3e
http://mail-archives.apache.org/mod_mbox/incubator-stdcxx-dev/200606.mbox/%3c449C4A43.4060402@roguewave.com%3e

> lib.string.io operator <<  doesn't call width (0) if  ios_base::failure exception occurred
> ------------------------------------------------------------------------------------------
>
>          Key: STDCXX-206
>          URL: http://issues.apache.org/jira/browse/STDCXX-206
>      Project: C++ Standard Library
>         Type: Bug

>   Components: 21. Strings
>     Versions: 4.1.3
>  Environment: all
>     Reporter: Anton Pevtsov
>     Assignee: Martin Sebor
>     Priority: Minor

>
> 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.
-
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