[clang-tools-extra] [clang-tidy] Improve integer comparison by matching valid expressions outside implicitCastExpr (PR #134188)

David Rivera via cfe-commits cfe-commits at lists.llvm.org
Fri May 2 21:42:16 PDT 2025


================
@@ -52,8 +54,17 @@ intCastExpression(bool IsSigned,
   const auto StaticCastExpr = cxxStaticCastExpr(has(ImplicitCastExpr));
   const auto FunctionalCastExpr = cxxFunctionalCastExpr(has(ImplicitCastExpr));
 
+  // Match function calls or variable references not directly wrapped by an
+  // implicit cast
+  const auto CallIntExpr = CastBindName.empty()
+                               ? callExpr(HasIntegerType)
+                               : callExpr(HasIntegerType).bind(CastBindName);
+  const auto DeclRefIntExpr =
----------------
RiverDave wrote:

Missed that, Fixed.

https://github.com/llvm/llvm-project/pull/134188


More information about the cfe-commits mailing list