<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - std::ifstream::failure doesn't report system error codes"
   href="https://bugs.llvm.org/show_bug.cgi?id=41068">41068</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>std::ifstream::failure doesn't report system error codes
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>8.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>FreeBSD
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>yuri@tsoft.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=21596" name="attach_21596" title="test.cpp">attachment 21596</a> <a href="attachment.cgi?id=21596&action=edit" title="test.cpp">[details]</a></span>
test.cpp

On FreeBSD the attached testcase triggers the errno=2 (No such file or
directory):
<span class="quote">>  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</span >

But the error message printed through the exception std::ifstream::failure
doesn't contain this information:
<span class="quote">> ios_base::clear: unspecified iostream_category error</span >

Why is it "unspecified"?

It should say exactly what happened.

FreeBSD 11.2.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>