https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66771
--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> --- Oops sorry, I mean: if (!m_input.getline(buf, sizeof(buf))) return false; The version comparing to 0 only works in C++03 (or non-conforming versions of libstdc++ pre-gcc-5) because testing a stream's state is done via implicit conversion to void*. In C++11 it is done via explicit conversion to bool, which is triggered by an explicit cast to bool, or a use in a conditional statement, or by negating it with !