X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:references :mime-version:content-type:content-transfer-encoding :in-reply-to; q=dns; s=default; b=CvL6bbbOmrwNlzxNInlolE+ESsw8CS jlDbSxrdism7jQlMy6xLsknziepBDOOT9ZlVmcel5VdrtNfifTYoQrE69hbFUHLT 86Hh4SjDJ00F/W2ddqi1pQT8hZGomKyjcJYHLyGehxeHdGteE0zpXYxEjCYn7xUI nNJ4PcWBy/7+c= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:references :mime-version:content-type:content-transfer-encoding :in-reply-to; s=default; bh=RjkI8BGaQrGZgcf/YS+xTWUsYSs=; b=w9Mb kJ3vz1RvBuBORl/BenFLvHQPHd9WsE/BhnrvkVdszPPbAwKrTS7p+YZUno3p/TA8 Ak2+C9xdRy6PPvA74fFfeXt4H8rsdgk87wfh/aixi6Sn+UjuDivr4puHdEHx5h1e Mx69SQZwE6zx2eQUUss/BQKEhg4IhzkmXYnODno= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: <cygwin.cygwin.com> List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com> List-Archive: <http://sourceware.org/ml/cygwin/> List-Post: <mailto:cygwin AT cygwin DOT com> List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 To: cygwin AT cygwin DOT com From: Ross Smith <ross DOT smith AT otoy DOT com> Subject: Re: GCC 7.3.0 -std=gnu++17 failed to getline() from std::ifstream Date: Mon, 11 Jun 2018 14:11:58 +1200 Lines: 50 Message-ID: <0d0d9dc4-5cce-724a-6fb2-7bf0a5a71db4@otoy.com> References: <CAHVoUt2pHP46o6ERwx9HB5=Dn-J9xv5i-53RYtJbdev-K9DCeQ AT mail DOT gmail DOT com> <a7b8e684-f985-f8f2-c7f2-79e618e8ece1 AT gmail DOT com> 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: <a7b8e684-f985-f8f2-c7f2-79e618e8ece1@gmail.com> X-IsSubscribed: yes Note-from-DJ: This may be spam 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 <fstream> >> #include <iostream> >> >> 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 <fstream> #include <iostream> 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