[llvm-bugs] [Bug 41068] New: std::ifstream::failure doesn't report system error codes

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Mar 14 08:24:24 PDT 2019


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

            Bug ID: 41068
           Summary: std::ifstream::failure doesn't report system error
                    codes
           Product: libc++
           Version: 8.0
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: yuri at tsoft.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

Created attachment 21596
  --> https://bugs.llvm.org/attachment.cgi?id=21596&action=edit
test.cpp

On FreeBSD the attached testcase triggers the errno=2 (No such file or
directory):
>  71779 io       CALL  open(0x4065e0,0x601<O_WRONLY|O_CREAT|O_TRUNC>,0666<S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH>)
>  71779 io       NAMI  "a/b"
>  71779 io       RET   open -1 errno 2 No such file or directory

But the error message printed through the exception std::ifstream::failure
doesn't contain this information:
> ios_base::clear: unspecified iostream_category error

Why is it "unspecified"?

It should say exactly what happened.

FreeBSD 11.2.

-- 
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/20190314/2dc09173/attachment.html>


More information about the llvm-bugs mailing list