]> granicus.if.org Git - clang/commitdiff
StaticAnalyzer: fix compiler warning. NFC
authorPavel Labath <labath@google.com>
Wed, 14 Mar 2018 10:16:40 +0000 (10:16 +0000)
committerPavel Labath <labath@google.com>
Wed, 14 Mar 2018 10:16:40 +0000 (10:16 +0000)
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

lib/StaticAnalyzer/Core/ExprEngine.cpp

index 25b4ebba0fbe85d352399ece82b787b648424b6b..2c3d2f0bc5cf7796c0e04deed1d098e9e09941d9 100644 (file)
@@ -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<ReturnedValueConstructionContext>(CC)) {
+    if (isa<ReturnedValueConstructionContext>(CC)) {
       const StackFrameContext *SFC = LC->getCurrentStackFrame();
       assert(SFC);
       if (SFC->getParent()) {