[clang-tools-extra] [clang-tidy] Improve redundant-casting check for binary operation (PR #191386)

Gaurav Dhingra via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 14 08:27:55 PDT 2026


================
@@ -168,6 +171,33 @@ void testFunctionalCastWithInitExpr(unsigned a) {
   unsigned c = unsigned{0};
 }
 
+void testBinaryOperatorRedundantCasting() {
+  const auto diff_types_operands1 { static_cast<float>(1.0f + 1) };
----------------
gxyd wrote:

How do you make something like this an "option"? Could you give me some pointers for where to look at doing such a thing?

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


More information about the cfe-commits mailing list