Fix a use-after-scope bug.
authorHaojian Wu <hokein@google.com>
Fri, 30 Nov 2018 09:23:01 +0000 (09:23 +0000)
committerHaojian Wu <hokein@google.com>
Fri, 30 Nov 2018 09:23:01 +0000 (09:23 +0000)
llvm-svn: 347970

clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp

index cffbf58..93a37aa 100644 (file)
@@ -31,7 +31,7 @@ static bool isNumericLiteralExpression(const Expr *E) {
 /// If type represents a pointer to CXXRecordDecl,
 /// and is not a typedef, return the decl name.
 /// Otherwise, return the serialization of type.
-static StringRef getPrettyTypeName(QualType QT) {
+static std::string getPrettyTypeName(QualType QT) {
   QualType PT = QT->getPointeeType();
   if (!PT.isNull() && !QT->getAs<TypedefType>())
     if (const auto *RD = PT->getAsCXXRecordDecl())