This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/86138] C++17: getline(istream, string) crashes on Cygwin because incompatible C++14 function is called
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 13 Jun 2018 22:03:18 +0000
- Subject: [Bug libstdc++/86138] C++17: getline(istream, string) crashes on Cygwin because incompatible C++14 function is called
- Auto-submitted: auto-generated
- References: <bug-86138-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86138
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Christian Franke from comment #0)
> As a consequence, no C++17 compatible code for this getline() is generated
> and the old getline() from cygstdc++-6.dll is called instead.
Why is the one in the DLL not compatible?
The extern templates are disabled because std::basic_string has additional
member functions in C++17 mode, and they're not instantiated in the library. By
disabling the explicit instantiation declarations the compiler will emit
definitions for the C++17-only member functions.
But there's nothing wrong with the getline instantiation in the DLL, it's
identical to what would be defined for C++17.
> AFAICS the above still holds for current SVN trunk release 261563.
>
> For a testcase and a proposed patch see:
> https://cygwin.com/ml/cygwin/2018-06/msg00125.html
As requested at https://gcc.gnu.org/bugs testcases need to be provided here,
not as URLs.