From: Haojian Wu Date: Fri, 30 Nov 2018 09:23:01 +0000 (+0000) Subject: Fix a use-after-scope bug. X-Git-Tag: llvmorg-8.0.0-rc1~3222 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ceff730fef35a835bfdc649806fb3bdeda907a8e;p=platform%2Fupstream%2Fllvm.git Fix a use-after-scope bug. llvm-svn: 347970 --- diff --git a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp index cffbf58..93a37aa 100644 --- a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp +++ b/clang/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())