diff options
author | Mikael Holmen <mikael.holmen@ericsson.com> | 2024-02-19 12:29:54 +0100 |
---|---|---|
committer | Mikael Holmen <mikael.holmen@ericsson.com> | 2024-02-19 13:03:17 +0100 |
commit | 19f6689f3bd330c631525a7409bc824d8dc95303 (patch) | |
tree | a50978adb47b7fbc8a07e6c083685fc031e4d3df | |
parent | 5b342e6041f8567a39354ae3c5346cf74b3bb84f (diff) | |
download | llvm-19f6689f3bd330c631525a7409bc824d8dc95303.zip llvm-19f6689f3bd330c631525a7409bc824d8dc95303.tar.gz llvm-19f6689f3bd330c631525a7409bc824d8dc95303.tar.bz2 |
[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(
| ^~~~~~
-rw-r--r-- | clang/lib/Analysis/UnsafeBufferUsage.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/Analysis/UnsafeBufferUsage.cpp b/clang/lib/Analysis/UnsafeBufferUsage.cpp index a11f224..701f1ac 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. |