<html>
    <head>
      <base href="https://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 --- - outback does not clear eofbit"
   href="https://llvm.org/bugs/show_bug.cgi?id=25053">25053</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>outback does not clear eofbit
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.7
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>akim.demaille@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hi!

It is my understanding than in C++11, contrary to C++98, the following program
has a well defined behavior, and I should get what I have put back in the
stream:

$ cat /tmp/foo.cc
#include <iostream>
#include <sstream>
#include <string>

int main()
{
  std::istringstream i{"a"};
  int c = i.get();
  std::cerr << c << '\n';
  i.peek();
  i.putback('A');
  c = i.peek();
  std::cerr << c << '\n';
}
$ clang++-mp-3.7 -std=c++14 /tmp/foo.cc
$ ./a.out
97
-1
$ clang++-mp-3.3 -std=c++11 /tmp/foo.cc
$ ./a.out
97
-1


Please, note that if I use unget instead of putback, I get the expected
behavior.

Cheers.</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>