From: Ross Smith <ross.smith@otoy.com>
To: cygwin@cygwin.com
Subject: Re: GCC 7.3.0 -std=gnu++17 failed to getline() from std::ifstream
Date: Mon, 11 Jun 2018 13:08:00 -0000 [thread overview]
Message-ID: <0d0d9dc4-5cce-724a-6fb2-7bf0a5a71db4@otoy.com> (raw)
Message-ID: <20180611130800.tJI0emb4fE1vZQwRiR1HTZH4MmkJqQ6qNNpCq3rArb4@z> (raw)
In-Reply-To: <a7b8e684-f985-f8f2-c7f2-79e618e8ece1@gmail.com>
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
next prev parent reply other threads:[~2018-06-11 2:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-05 20:32 Ivan Shynkarenka
2018-06-05 21:01 ` Marco Atzeri
2018-06-11 2:12 ` Ross Smith [this message]
2018-06-11 13:08 ` Ross Smith
2018-06-11 20:38 ` Marco Atzeri
2018-06-12 2:01 ` Ross Smith
2018-06-12 8:48 ` Ross Smith
2018-06-12 18:02 ` Christian Franke
2018-06-13 0:44 ` Ross Smith
2018-06-13 3:05 ` Ross Smith
2018-06-13 8:49 ` Marco Atzeri
2018-06-14 9:16 ` Christian Franke
2018-06-22 11:20 ` Christian Franke
-- strict thread matches above, loose matches on Subject: below --
2018-06-05 15:56 Ivan Shynkarenka
2018-06-05 19:13 ` Hans-Bernhard Bröker
2018-06-05 20:17 ` Marco Atzeri
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0d0d9dc4-5cce-724a-6fb2-7bf0a5a71db4@otoy.com \
--to=ross.smith@otoy.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).