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:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=fr3Dg9itSIMC/FKh r3yCY/8lvlQmBNIsSdni2rpxuNSGPxaBwoj3pOY8QUvsHwRYhNXYIFom6V2sFxdr +JVFTVSpRDuLeA55Tkjv0WQv4sJFW2kZej3348mFQ7P0ynnWN+0vJlW9Lpub7JsE PRg027AktkqjPLu+VwdieCfN/KQ= 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:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=AsVXhByBL5SHVZ7TOdufoz Hv2kI=; b=osjDFPsNS/PZ4E3+/qzQFuDgYPMEyVASPflpkbSd669qO8zrC4I+Je oWTpRstA1drd42vWsSAToecezS0qAAQru7BrZcYCA9pAU4o1eWaIBQoYuFfstIJ8 uER7SkchO42oddd8GjtqJAtUx0+uYgcZhUnguo2OMyWl5vz2y6L9c= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=fstream, HX-HELO:sk:mail-pl, H*r:sk:az12-v6, H*r:sk:mail-pl X-HELO: mail-pl0-f49.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:newsgroups:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=6k5J6PDEUOAyE6X5z60yxeJgx/s8pzBp40HwQCun9Bc=; b=DB/KMX0m+AoB5EYmOcYPino9ekGYuGeNrMLUAZpw+pPUPPS1g8vPFXmhdcrPAa/Cfp MXVuoXSJrMr678iw0uPYacgvZsUgv3ineR+SEi9VjZw6SPO1K4dmzm70y+kSfP4tjGWe OR9Kib/a0KbQyMf15VGf4oO1DI0lwaLRL47clLUjV24BEtfB2ksfv1ClmOJbtVAbOraU qIDAUP3maio2BrKtmD98OE70JeO9X4pdrBnY9axvTxPjQj/Jjlut91UAvONmw0JmbwnO IqN2gK+1rf56YQlQnQnQQ0Lq1q02PoyPQ1v4/y6qBIi3LbsUdPF/wafC9M+W1kd0HAiT 3ZZA== X-Gm-Message-State: APt69E0AfHIV/SP9BOMv0zB6nFc/4LxmVHRObjoEfxMqQ836EeJQ+275 0z8mZv01GZk9xm9N406c3gaPjY4= X-Google-Smtp-Source: ADUXVKIaz3NTDN8qtNZvZq6eYf0QCsl3kgJbQWk7EV6AMIkF3i0wVDwqawfAWW+pI8IWhjVNfJVwyA== X-Received: by 2002:a17:902:9a4b:: with SMTP id x11-v6mr16368105plv.176.1528683123623; Sun, 10 Jun 2018 19:12:03 -0700 (PDT) Subject: Re: GCC 7.3.0 -std=gnu++17 failed to getline() from std::ifstream To: cygwin AT cygwin DOT com Newsgroups: gmane.os.cygwin References: From: Ross Smith Message-ID: <0d0d9dc4-5cce-724a-6fb2-7bf0a5a71db4@otoy.com> Date: Mon, 11 Jun 2018 14:11:58 +1200 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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 >> #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