[PATCH] D54878: [clangd] NFC: Eliminate the unused variable warning.

Henry Wong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 25 06:42:34 PST 2018


MTC created this revision.
MTC added a reviewer: ilya-biryukov.
Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ioeric.

Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D54878

Files:
  clangd/AST.cpp


Index: clangd/AST.cpp
===================================================================
--- clangd/AST.cpp
+++ clangd/AST.cpp
@@ -95,11 +95,11 @@
     return Out.str();
   }
   // The name was empty, so present an anonymous entity.
-  if (auto *NS = llvm::dyn_cast<NamespaceDecl>(&ND))
+  if (isa<NamespaceDecl>(&ND))
     return "(anonymous namespace)";
   if (auto *Cls = llvm::dyn_cast<RecordDecl>(&ND))
     return ("(anonymous " + Cls->getKindName() + ")").str();
-  if (auto *En = llvm::dyn_cast<EnumDecl>(&ND))
+  if (isa<EnumDecl>(&ND))
     return "(anonymous enum)";
   return "(anonymous)";
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54878.175176.patch
Type: text/x-patch
Size: 607 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181125/0a8efca7/attachment.bin>


More information about the cfe-commits mailing list