[clang] [Clang] Consider preferred_type in bitfield warnings (#116760) (PR #116785)

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 4 10:51:32 PST 2025


ojhunt wrote:

> Looking at diagnostics in the test you add, I wonder why don't we issue them, and especially the fixit, when we parse bit-field declaration. Why waiting until assignment happens?

Yeah, it's super frustrating to me that we do that - I did _consider_ making them early but I really didn't want to simultaneously change that behavior and add a feature, and I thought making just preferred_type warnings early would be especially insane :D

GCC at least does warn on declaration, I'm not sure if there is a deliberate and historical reason that we delay notification, or if it is just happenstance.

I'd be onboard with making it a declaration warning in future.

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


More information about the cfe-commits mailing list