[llvm-bugs] [Bug 52301] New: boolalpha seems to ignore output width

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Oct 25 15:27:10 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=52301

            Bug ID: 52301
           Summary: boolalpha seems to ignore output width
           Product: libc++
           Version: 11.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: edward.vogel at hpe.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

It seems that the boolalpha fmtflag ignores any specified width. 

Here's a cut/paste from a cut/paste from a cygwin session:

$ cat t.cpp

#include <iomanip>
#include <sstream>
#include <iostream>
using namespace std;
int main(int, char *[])
{
        stringbuf sbuf;
        ostream ostr(&sbuf);
        ostr <<  boolalpha <<  setw(7) << (bool)false;
        string s = sbuf.str();
        cout << "'" << sbuf.str() << "'";
}

VogelEd at XLB3502Q4E ~/temp
$ clang++ -o a.out t.cpp

VogelEd at XLB3502Q4E ~/temp
$ ./a.out
'  false'
VogelEd at XLB3502Q4E ~/temp
$ clang++ -o a.out -stdlib=libc++ t.cpp

VogelEd at XLB3502Q4E ~/temp
$ ./a.out
'false'
VogelEd at XLB3502Q4E ~/temp

-- 
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/20211025/72c5604f/attachment.html>


More information about the llvm-bugs mailing list