Skip to content

Commit

Permalink
[clang] Remove unused variable [NFC]
Browse files Browse the repository at this point in the history
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(
       |                          ^~~~~~
  • Loading branch information
mikaelholmen committed Feb 19, 2024
1 parent 5b342e6 commit 19f6689
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions clang/lib/Analysis/UnsafeBufferUsage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 19f6689

Please sign in to comment.