From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69309 invoked by alias); 11 Jun 2018 02:12:12 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 69006 invoked by uid 89); 11 Jun 2018 02:12:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=H*r:Unknown, HContent-Transfer-Encoding:8bit X-HELO: blaine.gmane.org Received: from Unknown (HELO blaine.gmane.org) (195.159.176.226) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 11 Jun 2018 02:12:08 +0000 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fSCHK-0006Rs-2q for cygwin@cygwin.com; Mon, 11 Jun 2018 04:09:54 +0200 To: cygwin@cygwin.com From: Ross Smith Subject: Re: GCC 7.3.0 -std=gnu++17 failed to getline() from std::ifstream Date: Mon, 11 Jun 2018 13:08:00 -0000 Message-ID: <0d0d9dc4-5cce-724a-6fb2-7bf0a5a71db4@otoy.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 In-Reply-To: X-IsSubscribed: yes X-SW-Source: 2018-06/txt/msg00114.txt.bz2 Message-ID: <20180611130800.tJI0emb4fE1vZQwRiR1HTZH4MmkJqQ6qNNpCq3rArb4@z> On 2018-06-06 09:00, Marco Atzeri wrote: > On 6/5/2018 10:32 PM, Ivan Shynkarenka wrote: >>   Hello >> >> I use x64 bit Cygwin and it failed in my home, work and Appveyor.  I add >> cygcheck.out with my environment. >> >> I'm sorry about misspell prefix space in my prev example. Please try the >> following one: >> >> #include >> #include >> >> int main(int argc, char** argv) >> { >>      std::string line; >>      std::ifstream stream("test.cpp"); >>      while (getline(stream, line)) >>          std::cout << line << std::endl; >>      return 0; >> } >> >> g++ -std=gnu++17 test.cpp > > works fine on 32 bit and 64 bit on my W7 I'm having the same problem. My test program: #include #include int main() { std::ifstream in("demo.cpp"); std::string line; for (;;) { std::getline(in, line); if (! in && line.empty()) break; std::cout << line << "\n"; } } $ g++ demo.cpp -std=c++17 -o demo && ./demo Aborted (core dumped) It's crashing on the call to std::getline(). It only happens in -std=gnu++17 mode (or the equivalent gnu++1z, or c++17/1z). If I compile with -std=gnu++14 or lower it works. I'm using 64-bit Cygwin, everything updated to the current release, on Windows 8.1. Ross Smith -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple