https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78822

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I have no idea what the Go FE is doing, in the middle-end there are indeed 3-4
spots that use std::string in one file, but I'd just call it a mistake.
The reason for ensuring xmalloc_failed is used is to get sane and consistent
behavior on memory allocation failures (same error message with the same
detail), rather than just crashing the compiler, or saying terminate has been
called and similar.  I don't know what exactly you want to clean up with
std::string, if all you want is just a heap concatenation of strings, we have
also the concat function.  Of course not in all places a heap allocation is
desirable, but at that point std::string which will always do a heap allocation
is not desirable either.

Reply via email to