[clang-tools-extra] 5b74719 - [clangd] Fix -Wunused-variable warning (NFC)

Yang Fan via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 1 01:15:51 PDT 2021


Author: Yang Fan
Date: 2021-06-01T16:15:09+08:00
New Revision: 5b747197f8fb83bb7c256fa6cb2010445deb0a85

URL: https://github.com/llvm/llvm-project/commit/5b747197f8fb83bb7c256fa6cb2010445deb0a85
DIFF: https://github.com/llvm/llvm-project/commit/5b747197f8fb83bb7c256fa6cb2010445deb0a85.diff

LOG: [clangd] Fix -Wunused-variable warning (NFC)

GCC warning:
```
/llvm-project/clang-tools-extra/clangd/InlayHints.cpp: In member function ‘bool clang::clangd::InlayHintVisitor::VisitVarDecl(clang::VarDecl*)’:
/llvm-project/clang-tools-extra/clangd/InlayHints.cpp:81:15: warning: unused variable ‘AT’ [-Wunused-variable]
   81 |     if (auto *AT = D->getType()->getContainedAutoType()) {
      |               ^~

```

Added: 
    

Modified: 
    clang-tools-extra/clangd/InlayHints.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/InlayHints.cpp b/clang-tools-extra/clangd/InlayHints.cpp
index 9fbce419edd2..d0e0e961abcf 100644
--- a/clang-tools-extra/clangd/InlayHints.cpp
+++ b/clang-tools-extra/clangd/InlayHints.cpp
@@ -78,7 +78,7 @@ class InlayHintVisitor : public RecursiveASTVisitor<InlayHintVisitor> {
     if (isa<DecompositionDecl>(D))
       return true;
 
-    if (auto *AT = D->getType()->getContainedAutoType()) {
+    if (D->getType()->getContainedAutoType()) {
       if (!D->getType()->isDependentType()) {
         // Our current approach is to place the hint on the variable
         // and accordingly print the full type


        


More information about the cfe-commits mailing list