http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54392
--- Comment #13 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-08-29 23:21:25 UTC --- In fact, considering this issue a regression seems a bit of an over stretch to me: the empty rep case used to work essentially be chance, it's just a very special case (... of a very special case, which nobody bothered to report about in some 10 years). If you ask me, I would not handle this for std::string and fix it instead in vstring (where, by the way, a fix is straightforward and localized to _M_replace, I'll take care of that ASAP)