http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59756
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- The garbage is because your program has a bug. You match a temporary string, so the smatch object contains invalid iterators into an object that no longer exists.