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 <[email protected]>
Co-authored-by: Simon Pilgrim <[email protected]>

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();


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to