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

Congcong Cai via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 27 20:50:40 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 =
----------------
HerrCai0907 wrote:

Is there any usage of this variable?

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


More information about the cfe-commits mailing list