http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56166
--- Comment #8 from Tolga <fasdfasdas at gmail dot com> --- Correction, removing the copy, therefore reference counting effect, feels like has decreased the error but I found out std::string::clear() still throws std::length_error, although I use no reference.