Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-205

std::operator<<(ostream, string) calls width(0) regardless of sentry

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.1.3
    • 4.2.0
    • 21. Strings
    • None
    • all

    Description

      The following test fails:

      #include <iostream>
      #include <sstream>
      #include <string>
      #include <cassert>

      int main(int argc, char* argv[])
      {
      std::string str ("abcdefghijk");
      std::ostringstream os;
      const std::streamsize width = 2;

      os.width (width);
      os.clear (std::ios_base::failbit);

      os << str;
      assert (os.width () == width);

      return 0;
      }

      Attachments

        Issue Links

          Activity

            People

              sebor Martin Sebor
              pevtsov Anton Pevtsov
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: