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

Hal Finkel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 14 09:55:32 PDT 2017


hfinkel added a comment.

In https://reviews.llvm.org/D30923#700696, @rnk wrote:

> In https://reviews.llvm.org/D30923#700626, @hfinkel wrote:
>
> > In https://reviews.llvm.org/D30923#700620, @thakis wrote:
> >
> > > Maybe it should have some "to suppress the warning, do X" fixit?
> >
> >
> > I think we should at least include how many bits the field should have to fix the problem (pointing to the relevant field definition certainly seems helpful).
>
>
> Agreed, I was just hacking that together. :)
>
> 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.


https://reviews.llvm.org/D30923





More information about the cfe-commits mailing list