diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index b2387d3c7e16..21d66d049763 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -2277,7 +2277,7 @@ HelperSelectorsForTypoCorrection( StringRef Typo, const ObjCMethodDecl * Method) { const unsigned MaxEditDistance = 1; unsigned BestEditDistance = MaxEditDistance + 1; - StringRef MethodName = Method->getSelector().getAsString(); + std::string MethodName = Method->getSelector().getAsString(); unsigned MinPossibleEditDistance = abs((int)MethodName.size() - (int)Typo.size()); if (MinPossibleEditDistance > 0 &&