From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12606 invoked by alias); 6 Jul 2015 01:13:34 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 12586 invoked by uid 48); 6 Jul 2015 01:13:29 -0000 From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/66771] [5/6 Regression] -std=c++11 doesn't work Date: Mon, 06 Jul 2015 01:13:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 5.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-07/txt/msg00391.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66771 --- Comment #3 from H.J. Lu --- [hjl@gnu-ivb-1 build_base_lnx32e-gcc.0000]$ cat foo.cc #include char buf[300]; bool readLine(std::istream& m_input) { if (m_input.getline(buf, sizeof(buf)) == 0) return false; return true; } [hjl@gnu-ivb-1 build_base_lnx32e-gcc.0000]$ g++ -O2 -c foo.cc [hjl@gnu-ivb-1 build_base_lnx32e-gcc.0000]$ g++ -O2 -c foo.cc -std=c++11 foo.cc: In function \u2018bool readLine(std::istream&)\u2019: foo.cc:6:41: error: no match for \u2018operator==\u2019 (operand types are \u2018std::basic_istream::__istream_type {aka std::basic_istream}\u2019 and \u2018int\u2019) if (m_input.getline(buf, sizeof(buf)) == 0) ^ foo.cc:6:41: note: candidate: operator==(int, int) foo.cc:6:41: note: no known conversion for argument 1 from \u2018std::basic_istream::__istream_type {aka std::basic_istream}\u2019 to \u2018int\u2019 In file included from /usr/include/c++/5.1.1/bits/locale_facets.h:48:0, from /usr/include/c++/5.1.1/bits/basic_ios.h:37, from /usr/include/c++/5.1.1/ios:44, from /usr/include/c++/5.1.1/ostream:38, from /usr/include/c++/5.1.1/iostream:39, from foo.cc:1: /usr/include/c++/5.1.1/bits/streambuf_iterator.h:204:5: note: candidate: template bool std::operator==(const std::istreambuf_iterator<_CharT, _Traits>&, const std::istreambuf_iterator<_CharT, _Traits>&) operator==(const istreambuf_iterator<_CharT, _Traits>& __a, ^ /usr/include/c++/5.1.1/bits/streambuf_iterator.h:204:5: note: template argument deduction/substitution failed: ...