<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 1328: istream extractors not setting failbit if eofbit is already set</title>
<meta property="og:title" content="Issue 1328: istream extractors not setting failbit if eofbit is already set">
<meta property="og:description" content="C++ library issue. Status: Resolved">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue1328.html">
<meta property="og:type" content="website">
<meta property="og:image" content="http://cplusplus.github.io/LWG/images/cpp_logo.png">
<meta property="og:image:alt" content="C++ logo">
<style>
  p {text-align:justify}
  li {text-align:justify}
  pre code.backtick::before { content: "`" }
  pre code.backtick::after { content: "`" }
  blockquote.note
  {
    background-color:#E0E0E0;
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 1px;
    padding-bottom: 1px;
  }
  ins {background-color:#A0FFA0}
  del {background-color:#FFA0A0}
  table.issues-index { border: 1px solid; border-collapse: collapse; }
  table.issues-index th { text-align: center; padding: 4px; border: 1px solid; }
  table.issues-index td { padding: 4px; border: 1px solid; }
  table.issues-index td:nth-child(1) { text-align: right; }
  table.issues-index td:nth-child(2) { text-align: left; }
  table.issues-index td:nth-child(3) { text-align: left; }
  table.issues-index td:nth-child(4) { text-align: left; }
  table.issues-index td:nth-child(5) { text-align: center; }
  table.issues-index td:nth-child(6) { text-align: center; }
  table.issues-index td:nth-child(7) { text-align: left; }
  table.issues-index td:nth-child(5) span.no-pr { color: red; }
  @media (prefers-color-scheme: dark) {
     html {
        color: #ddd;
        background-color: black;
     }
     ins {
        background-color: #225522
     }
     del {
        background-color: #662222
     }
     a {
        color: #6af
     }
     a:visited {
        color: #6af
     }
     blockquote.note
     {
        background-color: rgba(255, 255, 255, .10)
     }
  }
</style>
</head>
<body>
<hr>
<p><em>This page is a snapshot from the LWG issues list, see the <a href="lwg-active.html">Library Active Issues List</a> for more information and the meaning of <a href="lwg-active.html#Resolved">Resolved</a> status.</em></p>
<h3 id="1328"><a href="lwg-defects.html#1328">1328</a>. istream extractors not setting <code>failbit</code> if <code>eofbit</code> is already set</h3>
<p><b>Section:</b> 31.7.5.2.4 <a href="https://wg21.link/istream.sentry">[istream.sentry]</a> <b>Status:</b> <a href="lwg-active.html#Resolved">Resolved</a>
 <b>Submitter:</b> Paolo Carlini <b>Opened:</b> 2010-02-17 <b>Last modified:</b> 2021-06-06</p>
<p><b>Priority: </b>Not Prioritized
</p>
<p><b>View all other</b> <a href="lwg-index.html#istream.sentry">issues</a> in [istream.sentry].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#Resolved">Resolved</a> status.</p>
<p><b>Discussion:</b></p>
<p>
Basing on the recent discussion on the library reflector, see c++std-lib-27728
and follow ups, I hereby formally ask for LWG 419 to be re-opened, the rationale
being that according to the current specifications, per
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n3000.pdf">n3000</a>,
it seems actually impossible to seek away from end of file, contrary to the
rationale which led <a href="lwg-closed.html#342" title="seek and eofbit (Status: NAD)">342</a><sup><a href="https://cplusplus.github.io/LWG/issue342" title="Latest snapshot">(i)</a></sup> to its closure as NAD. My request is also
supported by Martin Sebor, and I'd like also to add, as tentative proposed
resolution for the re-opened issue, the wording suggested by Sebor, thus, change
the beginning of  [istream::sentry]/2, to:
</p>

<blockquote><p>
2 <i>Effects:</i> If <code><ins>(!noskipws &amp;&amp; !</ins>is.good())</code> is
<code><del>false</del> <ins>true</ins></code>, calls <code>is.setstate(failbit)</code>.
Otherwise prepares for formatted or unformatted input. ...
</p></blockquote>

<p><i>[
2010-10 Batavia
]</i></p>


<p>
Resolved by adopting
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3168.htm">n3168</a>.
</p>

<p>
Previous proposed resolution:
<p/>
Change  [istream::sentry] p.2:
</p>

<blockquote><p>
2 <i>Effects:</i> If <code><ins>(!noskipws &amp;&amp; !</ins>is.good())</code> is
<code><del>false</del> <ins>true</ins></code>, calls <code>is.setstate(failbit)</code>.
Otherwise prepares for formatted or unformatted input. ...
</p></blockquote>


<p id="res-1328"><b>Proposed resolution:</b></p><p>
Addressed by paper
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3168.htm">n3168</a>.
</p>




</body>
</html>
