This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/66771] [5/6 Regression] -std=c++11 doesn't work


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 !


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]