Re: [PATCH] D24289: Add warning when assigning enums to bitfields without an explicit unsigned underlying type

2016-09-08 Thread Sasha Bermeister via cfe-commits
sashab updated this revision to Diff 70760. sashab marked an inline comment as done. sashab added a comment. Thanks for your feedback everyone; left the flag as DefaultIgnore but added it to -Wall. Keep in mind I am planning on adding two additional warnings after this, namely "%0 is too small t

Re: [PATCH] D24289: Add warning when assigning enums to bitfields without an explicit unsigned underlying type

2016-09-14 Thread Sasha Bermeister via cfe-commits
sashab added a comment. Pinging for another LGTM since I have added it to -Wall and added a portability comment to the error message :) https://reviews.llvm.org/D24289 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cg

Re: [PATCH] D24289: Add warning when assigning enums to bitfields without an explicit unsigned underlying type

2016-09-16 Thread Sasha Bermeister via cfe-commits
sashab added a comment. Thanks all! :) Comment at: test/SemaCXX/warn-msvc-enum-bitfield.cpp:12 @@ +11,3 @@ + + s.e2 = E2; + s.f2 = F2; thakis wrote: > Shouldn't this be the version that warns? The assignment with E1 assigns 0 > which is portable, but this ass

Re: [PATCH] D24289: Add warning when assigning enums to bitfields without an explicit unsigned underlying type

2016-09-16 Thread Sasha Bermeister via cfe-commits
sashab marked an inline comment as done. sashab added a comment. https://reviews.llvm.org/D24289 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D24289: Add warning when assigning enums to bitfields without an explicit unsigned underlying type

2016-09-16 Thread Sasha Bermeister via cfe-commits
sashab closed this revision. sashab added a comment. Is this how I commit this? Hopefully this lands... :-) https://reviews.llvm.org/D24289 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

Re: [PATCH] D24289: Add warning when assigning enums to bitfields without an explicit unsigned underlying type

2016-11-17 Thread Sasha Bermeister via cfe-commits
Although I agree with your philosophical discussion and suggestions, the reality is that MSVC's behavior is not a bug and compilers are free to interpret enum bitfields with no explicit underlying type in any way they want (see spec reference in GCC bug link), with a signed interpretation being a v

Re: [PATCH] D24289: Add warning when assigning enums to bitfields without an explicit unsigned underlying type

2016-11-20 Thread Sasha Bermeister via cfe-commits
Thanks for the great explanation, I agree with this advice. I'm going to investigate writing a new patch to do this. On Fri, Nov 18, 2016 at 1:59 PM, Arthur O'Dwyer wrote: > On Thu, Nov 17, 2016 at 2:14 PM, Sasha Bermeister > wrote: > >> Although I agree with your philosophical discussion and s

[PATCH] D24289: Add warning when assigning enums to bitfields without an explicit unsigned underlying type

2016-11-10 Thread Sasha Bermeister via cfe-commits
sashab added a comment. Sorry, had this discussion elsewhere (https://bugs.chromium.org/p/chromium/issues/detail?id=648462). I'm uncertain at this point. There is currently a bug in GCC that means enums with an explicit underlying type (or enum classes, although the latter is to be fixed) are