https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78822
--- Comment #14 from janus at gcc dot gnu.org --- Created attachment 40350 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40350&action=edit patch using build_message_string So here is another patch, similar to the one in comment 5, but using build_message_string instead of std::string. Apparently this works pretty nicely as well (at least it regtests cleanly). Regarding readability, I'd say it's a matter of taste (and what you're used to). One advantage of the std::string version is obviously that it cleans up after itself and one doesn't need to free up things manually. But in general I'm still not sure how well it plays along with GCC's ideas of memory management.