From: Marco Atzeri <marco.atzeri@gmail.com>
To: cygwin@cygwin.com
Subject: Re: GCC 7.3.0 -std=gnu++17 failed to getline() from std::ifstream
Date: Wed, 13 Jun 2018 08:49:00 -0000 [thread overview]
Message-ID: <da63d7d5-4ccc-8171-710a-0105219888e3@gmail.com> (raw)
In-Reply-To: <0725bdbd-0411-138a-7ea9-d6395e3256e3@t-online.de>
On 6/12/2018 7:11 PM, Christian Franke wrote:
> Ivan Shynkarenka wrote:
> Could reproduce this with 32 and 64 bit Cygwin g++ 7.3.0
>
> A comparison of preprocessor (-E) outputs shows that the "extern
> template" declarations for getline() are only visible for C++ <= 14.
> These are guarded by "__cplusplus <= 1402" in basic_string.tcc. This
> should tell the compiler to generate new code for getline() if C++17 is
> enabled instead of calling the (now incompatible) function in
> cygstdc++-6.dll.
>
> A comparison of assembly (-S) outputs shows that this does not work: If
> C++17 is enabled, the compiler correctly generates local code for
> getline(istream &, string &) but this code calls an external
> getline(istream &, string &, char). Then the linker generates a call to
> this getline() in cygstdc++-6.dll.
>
> This is because there is a bogus prototype specialization for
> getline(istream &, string &, char) in basic_string.h but no
> corresponding implementation in basic_string.tcc. This has apparently an
> equivalent effect as 'extern template'.
>
> The attached patch for
> Â /usr/lib/gcc/*-pc-cygwin/7.3.0/include/c++/bits/basic_string.h
> fixes this.
>
> Christian
>
Thanks Christian
for the investigation.
It seems an upstream bug so could you report it there ?
There are several c++17 bugs around
https://gcc.gnu.org/bugzilla/buglist.cgi?quicksearch=c%2B%2B17
that is probably the reason why gcc 7.x defaults to c++14
Regards
Marco
--
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-13 6: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
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 [this message]
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=da63d7d5-4ccc-8171-710a-0105219888e3@gmail.com \
--to=marco.atzeri@gmail.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).