title: libc++ std::istringstream doesn't thrown exceptions. Bug?
body: <p>After configuring a <code>std::istringstream</code> to throw exceptions when <code>failbit</code> is set I get no exceptions happening with libc++ (this is under linux with libc++ compiled with support from libcxxrt). I suppose this is a bug in libc++ or libcxxrt:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;sstream&gt;
  
  template&lt;typename T&gt; std::istream &amp;getvalue(std::istream &amp;is, T &amp;value, const T &amp;default_value = T())
  {
      std::stringstream ss;
      std::string s;
      std::getline(is, s, ',');
      ss &lt;&lt; s;
      if((ss &gt;&gt; value).fail())
          value = default_value;
      return is;
  }
  
  int main()
  {
      std::string s = "123,456,789";
      std::istringstream is(s);
      unsigned n;
  
      try
      {
          is.exceptions(std::ios::failbit | std::ios::eofbit);
  
          getvalue(is, n);
          std::cout &lt;&lt; n &lt;&lt; std::endl;
  
          getvalue(is, n);
          std::cout &lt;&lt; n &lt;&lt; std::endl;
  
          // Disable EOF exception on last bit
          is.exceptions(std::ios::failbit);
  
          getvalue(is, n);
          std::cout &lt;&lt; n &lt;&lt; std::endl;
  
          // Force Fail reading after EOF
          getvalue(is, n);
          std::cout &lt;&lt; n &lt;&lt; std::endl;
      }
      catch(std::ios::failure &amp;fail)
      {
          std::cout &lt;&lt; "Fail" &lt;&lt; std::endl;
      }
  }
  </code></pre>
  
  <p>output for libstdc++:</p>
  
  <pre><code>123
  456
  789
  Fail
  </code></pre>
  
  <p>libc++/libcxxrt output:</p>
  
  <pre><code>123
  456
  789
  0
  </code></pre>
  
  <h3>EDIT</h3>
  
  <p>Also tested on OS X.</p>
  
  <p>Bug submitted: <a href="http://llvm.org/bugs/show_bug.cgi?id=15949" rel="nofollow">http://llvm.org/bugs/show_bug.cgi?id=15949</a></p>