[LLVMbugs] [Bug 17027] New: std::ostringstream produces unexpected results

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Aug 28 12:16:54 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=17027

            Bug ID: 17027
           Summary: std::ostringstream produces unexpected results
           Product: libc++
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: hhinnant at apple.com
          Reporter: libcxx at pureabstract.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

On OS X, using clang & libc++ as shipped with XCode 4.6.3.

The following code fails:



#include <iomanip>
#include <sstream>
#include <cassert>

int main()
{
    std::ostringstream os;
    os << std::setw(2) << 1;
    assert( os.str() == " 1" );
}



when compiled with:

clang++ -std=c++11 -stdlib=libc++ example.cpp

A cursory examination suggests that the default fill character is being set to
-1.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130828/23b290e9/attachment.html>


More information about the llvm-bugs mailing list