http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52540
--- Comment #9 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-03-11 11:20:40 UTC --- Then this is a very old issue, isn't it? Why nobody noticed it before? To be clear, in debug-mode we don't use extern templates only for basic_string (because _GLIBCXX_EXTERN_TEMPLATE becomes -1 when _GLIBCXX_DEBUG is defined), all the other facilities remain the same still use extern tamplate. This is in order to enable debug-mode checks also at -O0 for basic_string. Now, I don't see why a few less extern template can make a difference on mingw in terms of correctness of use_facet or anything else, but if that's really the case due to fundamental limitations somehwhere, we can trade it for the -O0 basic_string checks on the affected systems, I have no problems with that (note that, AFAICS, the problem will not go away with a new C++11 conforming string class, unless we decide to not export from the .so parts of basic_string)