[clang-tools-extra] [clang-tidy] Add check 'bugprone-cast-to-struct' (PR #153428)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 18 02:57:19 PDT 2025


NagyDonat wrote:

> Would it make sense to extend the warning to any pointer cast, not only `struct` types?

I feel that it is reasonable to limit this to `struct`s, especially right now as we introduce this as a replacement for the checker in the Static Analyzer. Let's publish this check this way now and postpone the discussion about its potential generalization for follow-up commits.

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


More information about the cfe-commits mailing list