[clang] [Clang] Improve ``-Wtautological-overlap-compare`` diagnostics flag (PR #133653)

via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 14 14:26:53 PDT 2025


================
@@ -93,16 +94,16 @@ static bool IsIntegerLiteralConstantExpr(const Expr *E) {
       return false;
     E = UO->getSubExpr();
   }
-
-  return isa<IntegerLiteral>(E);
+  return isa<IntegerLiteral>(E) || isa<CharacterLiteral>(E) ||
+         isa<FloatingLiteral>(E);
----------------
Sirraide wrote:

```suggestion
  return isa<IntegerLiteral, CharacterLiteral, FloatingLiteral>(E);
```
I was recently reminded of the fact that `isa` is in fact variadic.

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


More information about the cfe-commits mailing list