[PATCH] D30923: Warn on enum assignment to bitfields that can't fit all values

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 14 10:44:52 PDT 2017


rnk added a comment.

In https://reviews.llvm.org/D30923#700708, @hfinkel wrote:

> In https://reviews.llvm.org/D30923#700696, @rnk wrote:
>
> > Do you think it's worth indicating that the error can be suppressed with an explicit cast, or is that wasted space?
>
>
> What might this look like? Also, I don't see a regression test for this.


The warning only looks through implicit casts and paren exprs, so it could look like this:  `f.two_bits = (unsigned)three_bits;` I added a test for it.


https://reviews.llvm.org/D30923





More information about the cfe-commits mailing list