From: Pavel Labath Date: Wed, 14 Mar 2018 10:16:40 +0000 (+0000) Subject: StaticAnalyzer: fix compiler warning. NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5f4ef08259dc1312f8ad47203a3e6bbe52ab84b7;p=clang StaticAnalyzer: fix compiler warning. NFC My compiler (clang-3.8) complains that the RCC variable is unused. That's not really true, as it's checked by the if-declaration, but it's also kinda true, because we don't need to declaration if we only check it in the if statement. In reality, all this means that the dyn_cast<> can be replaced by isa<>, so that's what I do here. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@327491 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Core/ExprEngine.cpp b/lib/StaticAnalyzer/Core/ExprEngine.cpp index 25b4ebba0f..2c3d2f0bc5 100644 --- a/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -464,7 +464,7 @@ ProgramStateRef ExprEngine::addAllNecessaryTemporaryInfo( // If the temporary is being returned from the function, it will be // destroyed or lifetime-extended in the caller stack frame. - if (const auto *RCC = dyn_cast(CC)) { + if (isa(CC)) { const StackFrameContext *SFC = LC->getCurrentStackFrame(); assert(SFC); if (SFC->getParent()) {