https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121814
--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Jonathan Wakely from comment #3) > And __s += *c not __s += c; > > Don't you want to append single characters, not a char* that isn't even > null-terminated? of course the whole loop could be replaced by simply s.append(cs, len), or it would probably make more sense to use s.assign(cs, len) since I don't see why you'd want to preserve the previous contents of the string.