]> granicus.if.org Git - clang/commitdiff
[ASTDump] NFC: Move variable into if() statement
authorStephen Kelly <steveire@gmail.com>
Fri, 18 Jan 2019 22:15:09 +0000 (22:15 +0000)
committerStephen Kelly <steveire@gmail.com>
Fri, 18 Jan 2019 22:15:09 +0000 (22:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351605 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTDumper.cpp

index 2b9b132eea7a9b86214ed96eae7dc0a3f079ac6a..99e4a1bc5830e3d2d1d4b22a33960238ddd20fac 100644 (file)
@@ -513,8 +513,7 @@ void ASTDumper::dumpDecl(const Decl *D) {
 
     // Decls within functions are visited by the body.
     if (!isa<FunctionDecl>(*D) && !isa<ObjCMethodDecl>(*D)) {
-      auto DC = dyn_cast<DeclContext>(D);
-      if (DC)
+      if (const auto *DC = dyn_cast<DeclContext>(D))
         dumpDeclContext(DC);
     }
   });