]> granicus.if.org Git - clang/commitdiff
Use std::string instead of llvm::StringRef to avoid dangling ref.
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 3 Sep 2010 18:01:09 +0000 (18:01 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 3 Sep 2010 18:01:09 +0000 (18:01 +0000)
Per Chris's comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112979 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseObjc.cpp

index e0f9e2907b5777d34d69215a9920a3c7f96878a5..6861ce940f7657b88134bd92418faccfcd8792d4 100644 (file)
@@ -599,7 +599,7 @@ IdentifierInfo *Parser::ParseObjCSelectorPiece(SourceLocation &SelectorLoc) {
   case tok::pipeequal:
   case tok::caret:
   case tok::caretequal: {
-    llvm::StringRef ThisTok = PP.getSpelling(Tok);
+    std::string ThisTok(PP.getSpelling(Tok));
     if (isalpha(ThisTok[0])) {
       IdentifierInfo *II = &PP.getIdentifierTable().get(ThisTok.data());
       Tok.setKind(tok::identifier);