This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/66771] [5/6 Regression] -std=c++11 doesn't work
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 06 Jul 2015 08:11:44 +0000
- Subject: [Bug libstdc++/66771] [5/6 Regression] -std=c++11 doesn't work
- Auto-submitted: auto-generated
- References: <bug-66771-4 at http dot gcc dot gnu dot org/bugzilla/>
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 !