[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 19 09:21:10 PDT 2023


Endilll wrote:

> which brings up an additional concern/thing to deal with for the non_storable attribute (that is, do we apply it to assignments? how about exact-assignments like you've done there?).

Conservative approach would be to issue diagnostics based on `non_storable` only when LHS of assignment was checked taking it into account. In other words, LHS is a bit-field with `preferred_type`, so `non_storable` enumerator was excluded when computing how many bits are required to store the enum.

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


More information about the cfe-commits mailing list