[clang-tools-extra] [clang-tidy][NFC] Clean up and slightly optimize `modernize-use-integer-sign-comparison` (PR #163492)

Victor Chernyakin via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 14 21:26:46 PDT 2025


================
@@ -34,13 +34,12 @@ AST_MATCHER(clang::QualType, isActualChar) {
 } // namespace
 
 static BindableMatcher<clang::Stmt>
-intCastExpression(bool IsSigned,
-                  const std::string &CastBindName = std::string()) {
+intCastExpression(bool IsSigned, StringRef CastBindName = {}) {
   // std::cmp_{} functions trigger a compile-time error if either LHS or RHS
   // is a non-integer type, char, enum or bool
   // (unsigned char/ signed char are Ok and can be used).
   auto IntTypeExpr = expr(hasType(hasCanonicalType(qualType(
-      isInteger(), IsSigned ? isSignedInteger() : isUnsignedInteger(),
----------------
localspook wrote:

`isInteger()` is redundant when we have `isSignedInteger()` or `isUnsignedInteger()`

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


More information about the cfe-commits mailing list