This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/86138] C++17: getline(istream, string) crashes on Cygwin because incompatible C++14 function is called


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86138

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|2018-06-15 00:00:00         |2018-06-19
     Ever confirmed|0                           |1

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Christian Franke from comment #5)
> (In reply to Jonathan Wakely from comment #4)
> > What's bogus about it?
> 
> Here a simple example which demonstrates the same situation:
> 
> $ cat bug.cpp
> template<typename T> void f(T & x) { x = T(); }
> 
> #ifndef FIXED
> template<> void f(int &);
> // no visible implementation => same effect as extern template below!

Not true. Declaring the specialization says there is an explicit
specialization. That's not the same as declaring an explicit instantiation.
Both will prevent the implicit instantiation of the primary template, but they
still mean different things.

You still haven't explained why declaring the specialization is bogus. The
explicit specialization is defined at 
https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=libstdc%2B%2B-v3/src/c%2B%2B98/istream-string.cc;h=feb3569c8be48539af52b66d6462c455dfd09a47;hb=HEAD#l120

Why do you think it's bogus to declare that?

"It fixes my crash" doesn't make it bogus.


> > This patch won't be accepted, it's papering over some other problem not
> > fixing anything.
> 
> I disagree. This should be fixed anyway, see above.

There's nothing to fix.

If Cygwin doesn't correctly ensure uniqueness of static objects across DLLs
then we can't workaround that, but simply deleting the declaration of the
specialization is wrong (and will result in worse performance because the
specialization for 'char' will not be used when it could be).

Does Cygwin's binutils not support STB_GNU_UNIQUE or the equivalent?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]