[clang] [clang-tools-extra] [clang-tidy] Add new check: `readability-redundant-typename` (PR #161574)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 3 03:38:43 PDT 2025


================
@@ -2763,6 +2763,17 @@ extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXDynamicCastExpr>
 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXConstCastExpr>
     cxxConstCastExpr;
 
+/// Matches any named cast expression.
+///
+/// Example: Matches all four of the casts in
+/// \code
+///   struct S { virtual void f(); };
+///   void* ptr = dynamic_cast<void*>(reinterpret_cast<S*>(
+///                    const_cast<int*>(static_cast<int*>(nullptr))));
----------------
vbvictor wrote:

Could we make this one-by-one on each line. Nested casts are hard to read.

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


More information about the cfe-commits mailing list