A better version of r181699: use raw_string_ostream.str() instead of manually calling .flush().