[llvm-bugs] [Bug 52157] New: sync() not setting rdstate on certain errors

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 12 12:32:10 PDT 2021


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

            Bug ID: 52157
           Summary: sync() not setting rdstate on certain errors
           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

The code in istream that implements sync contains:

            if (this->rdbuf()->pubsync() == -1)
            {
                __state |= ios_base::badbit;
                return -1;
            }

I believe this is wrong.   There needs to be a call to:

        this->setstate(__state);

before the  return.   Older versions got this right.

Not a bad problem, but I thought I'd report it.

Thank you,

Ed Vogel

-- 
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/20211012/dba387e8/attachment.html>


More information about the llvm-bugs mailing list