https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125969
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- A reliable solution would be to use abi_tag on all std::string functions with assertions, and export both symbols, with and without the tag. Then we wouldn't need to disable the explicit instantiation declarations when assertions are enabled, the callers would just link to the explicit instantiation definitions with tags. This is what libc++ does for its hardened preconditions. But it would add a lot of new symbols to the library, for unclear benefit. In most cases, small functions get inlined and the assertions are either enabled (or disabled) as appropriate for the current TU.
