thakis added a comment. Works for me if rnk likes it :-)
(We could bikeshed on if this should be one of the -Wmicrosoft warnings, but the warning can't be both in -Wall and -Wmicrosoft, so let's don't). I do have a question about the test (the first commit below): ================ Comment at: test/SemaCXX/warn-msvc-enum-bitfield.cpp:12 @@ +11,3 @@ + + s.e2 = E2; + s.f2 = F2; ---------------- Shouldn't this be the version that warns? The assignment with E1 assigns 0 which is portable, but this assigns 1 which overflows, right? ================ Comment at: test/SemaCXX/warn-msvc-enum-bitfield.cpp:39 @@ +38,3 @@ + s.e2 = E2; + s.f2 = F2; +} ---------------- We have -Wconversion warnings for similar cases; maybe we should have this here too (but not in this change): Nicos-MBP:llvm-build thakis$ cat test2.cc enum E {e1, e2}; struct S { E e1 : 1; }; void f() { short s1 = 65536; short s2 = 32769; S s; s.e1 = e2; } Nicos-MBP:llvm-build thakis$ clang -Wconversion -c test2.cc test2.cc:8:14: warning: implicit conversion changes signedness: 'int' to 'short' [-Wsign-conversion] short s2 = 32769; ~~ ^~~~~ test2.cc:7:14: warning: implicit conversion from 'int' to 'short' changes value from 65536 to 0 [-Wconstant-conversion] short s1 = 65536; ~~ ^~~~~ 2 warnings generated. https://reviews.llvm.org/D24289 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits