[clang] 19f6689 - [clang] Remove unused variable [NFC]

Mikael Holmen via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 19 04:04:33 PST 2024


Author: Mikael Holmen
Date: 2024-02-19T13:03:17+01:00
New Revision: 19f6689f3bd330c631525a7409bc824d8dc95303

URL: https://github.com/llvm/llvm-project/commit/19f6689f3bd330c631525a7409bc824d8dc95303
DIFF: https://github.com/llvm/llvm-project/commit/19f6689f3bd330c631525a7409bc824d8dc95303.diff

LOG: [clang] Remove unused variable [NFC]

Without the fix gcc warned like
 ../../clang/lib/Analysis/UnsafeBufferUsage.cpp:2203:26: warning: unused variable 'CArrTy' [-Wunused-variable]
  2203 |   } else if (const auto *CArrTy = Ctx.getAsConstantArrayType(
       |                          ^~~~~~

Added: 
    

Modified: 
    clang/lib/Analysis/UnsafeBufferUsage.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Analysis/UnsafeBufferUsage.cpp b/clang/lib/Analysis/UnsafeBufferUsage.cpp
index a11f224170d5a6..701f1ac852c256 100644
--- a/clang/lib/Analysis/UnsafeBufferUsage.cpp
+++ b/clang/lib/Analysis/UnsafeBufferUsage.cpp
@@ -2200,8 +2200,7 @@ FixVarInitializerWithSpan(const Expr *Init, ASTContext &Ctx,
       // Although the initializer is not allocating a buffer, the pointer
       // variable could still be used in buffer access operations.
       ExtentText = One;
-  } else if (const auto *CArrTy = Ctx.getAsConstantArrayType(
-                 Init->IgnoreImpCasts()->getType())) {
+  } else if (Ctx.getAsConstantArrayType(Init->IgnoreImpCasts()->getType())) {
     // std::span has a single parameter constructor for initialization with
     // constant size array. The size is auto-deduced as the constructor is a
     // function template. The correct fixit is empty - no changes should happen.


        


More information about the cfe-commits mailing list