]> granicus.if.org Git - clang/commitdiff
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)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347970 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp

index cffbf58dff7d334fe9c56e75f71f855c3a867fdf..93a37aaf52208d5ad3675645921b9c390df44563 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())