[clang-tools-extra] [clang-tidy] bugprone-implicit-widening ignores const exprs that fit (PR #98352)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 10 11:12:06 PDT 2024


================
@@ -84,6 +86,19 @@ void ImplicitWideningOfMultiplicationResultCheck::handleImplicitCastExpr(
   if (TgtWidth <= SrcWidth)
     return;
 
+  // Is the expression a compile-time constexpr that we know can fit in the
+  // source type?
+  if (IgnoreConstantIntExpr && ETy->isIntegerType() &&
----------------
PiotrZSL wrote:

why limiting this only to Int, why not supporting unsigned int also ?

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


More information about the cfe-commits mailing list