From: Haojian Wu Date: Fri, 30 Nov 2018 09:23:01 +0000 (+0000) Subject: Fix a use-after-scope bug. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0eeda76b8325ae183af3ff739b194755a53c7a78;p=clang Fix a use-after-scope bug. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347970 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp b/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp index cffbf58dff..93a37aaf52 100644 --- a/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp +++ b/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp @@ -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()) if (const auto *RD = PT->getAsCXXRecordDecl())