Use std::string instead of StringRef to prevent use-after-free.

Discovered by asan.

llvm-svn: 231421
This commit is contained in:
Daniel Jasper 2015-03-05 23:17:32 +00:00
parent 12ba733ce8
commit 08201e394e
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ void NamespaceCommentCheck::check(const MatchFinder::MatchResult &Result) {
bool NeedLineBreak = NextTokenIsOnSameLine && Tok.isNot(tok::eof);
SourceRange OldCommentRange(AfterRBrace, AfterRBrace);
StringRef Message = "%0 not terminated with a closing comment";
std::string Message = "%0 not terminated with a closing comment";
// Try to find existing namespace closing comment on the same line.
if (Tok.is(tok::comment) && NextTokenIsOnSameLine) {