[clang] 03c8624 - [clang:ast] Avoid warning for unused var without assertions. (NFC) (#169822)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 27 11:01:10 PST 2025
Author: Ingo Müller
Date: 2025-11-27T20:01:05+01:00
New Revision: 03c86242929c1b05f417aa5ddd016b7664e22d4e
URL: https://github.com/llvm/llvm-project/commit/03c86242929c1b05f417aa5ddd016b7664e22d4e
DIFF: https://github.com/llvm/llvm-project/commit/03c86242929c1b05f417aa5ddd016b7664e22d4e.diff
LOG: [clang:ast] Avoid warning for unused var without assertions. (NFC) (#169822)
This PR avoids a compiler warning, which turns into an error with
`-Werror`, for a variable introduced in #169276 and only used in an
assertion (which is, thus, unused if compiled without assertions).
Signed-off-by: Ingo Müller <ingomueller at google.com>
Co-authored-by: Simon Pilgrim <llvm-dev at redking.me.uk>
Added:
Modified:
clang/lib/AST/ExprConstant.cpp
Removed:
################################################################################
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 7b9380de6834d..cab17ecdc7b29 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -12179,8 +12179,8 @@ static bool evalShiftWithCount(
assert(Call->getNumArgs() == 2);
QualType SourceTy = Call->getArg(0)->getType();
- QualType CountTy = Call->getArg(1)->getType();
- assert(SourceTy->isVectorType() && CountTy->isVectorType());
+ assert(SourceTy->isVectorType() &&
+ Call->getArg(1)->getType()->isVectorType());
QualType DestEltTy = SourceTy->castAs<VectorType>()->getElementType();
unsigned DestEltWidth = Source.getVectorElt(0).getInt().getBitWidth();
More information about the cfe-commits
mailing list