[clang] [Clang] Add -Wcounted-by-addrof to warn when &fam discards __counted_by (PR #206760)

Yeoul Na via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 17 10:31:24 PDT 2026


rapidsna wrote:

> Yeah, this was my thinking as well; basically, `__counted_by` would actually be involved in all of those cases because it's providing more information which the type system should be free to use, so I was expecting us to treat it like `char (*)[__counted_by(n)]`.
> 
> If we don't go that route, then I agree the diagnostic in the PR makes sense. So maybe this is a temporary diagnostic while research is done to see whether we can make use of the extra type information?

@AaronBallman Yes! That sounds good to me.

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


More information about the cfe-commits mailing list