https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86138
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |UNCONFIRMED Ever confirmed|1 |0 --- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Christian Franke from comment #3) > > 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. > This has no effect due to the bogus specialization in basic_string.h (see > patch below). What's bogus about it? > Sorry. New testcase below: Thanks. > $ g++ -std=c++17 -o getlinetest getlinetest.cpp && ./getlinetest; echo $? > Aborted (core dumped) > 134 Could you please debug this to find where it's crashing and why? > $ g++ -std=c++17 -static -o getlinetest getlinetest.cpp && ./getlinetest;\ > echo $? > 42 > > Interestingly the statically linked version works. Is there possibly some > template function called by getline() which is not C++17 compatible? There should be nothing in libstdc++ which is not C++17 compatible. > Possible fix (char only, should also be done for wchar_t): This patch won't be accepted, it's papering over some other problem not fixing anything.