<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </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 --- - fstream::readsome can not read any data"
   href="http://llvm.org/bugs/show_bug.cgi?id=16783">16783</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>fstream::readsome can not read any data
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </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>hhinnant@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>xtaotao@qq.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I download the libcxx 3.3 source with llvm 3.3 release version source. and
compiler it with libunwind, libcxxrt.

// clang++ a.cpp -std=c++11 -stdlib=libc++
// ubuntu 13.04
// clang version 3.3

#include <fstream>
#include <iostream>

int main(int argc, char* argv[])
{
    std::ifstream fs(argv[0], std::ios::in);
    char szBuffer[1024];
    auto readSize = fs.readsome(szBuffer, 1024);
    std::cout << "read size: " << readSize << ", rdstate: " << fs.rdstate() <<
", good: " << fs.good() << ", eof: " << fs.eof() << "." << std::endl;
    // output: read size: 0, rdstate: 0, good: 1, eof: 0.

    auto beginPos = fs.tellg();
    fs.read(szBuffer, 1024);
    auto newPos = fs.tellg();
    std::cout << "read size: " << newPos - beginPos << ", rdstate: " <<
fs.rdstate() << ", good: " << fs.good() << ", eof: " << fs.eof() << "." <<
std::endl;
    // output: read size: 1024, rdstate: 0, good: 1, eof: 0.

    return 0;
}</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>