https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80331
--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #7) > With -std=c++20 -O2 I get better code than just -std=c++17 -O2: > _34 = operator new (24); > __builtin_memcpy (_34, "a ", 23); > MEM[(char_type &)_34 + 23] = 0; > operator delete (_34, 24); > > That is all I think due to what is referenced in PR 86590. Yes, it's because the explicit instantiations are disabled for C++20: # if __cplusplus <= 201703L && _GLIBCXX_EXTERN_TEMPLATE > 0 extern template class basic_string<char>;