Allow -1 to assign max value to unsigned bitfields.
authorRichard Trieu <rtrieu@google.com>
Fri, 5 Aug 2016 02:39:30 +0000 (02:39 +0000)
committerRichard Trieu <rtrieu@google.com>
Fri, 5 Aug 2016 02:39:30 +0000 (02:39 +0000)
commit7561ed01cb762d336d60dc2b05faab6c948e11fd
tree860d64bcc17e554b261176f6935f726ce28849b6
parenta425623dd9907bf5433e2bf0f64b7e0dcb2b4a8a
Allow -1 to assign max value to unsigned bitfields.

Silence the -Wbitfield-constant-conversion warning for when -1 or other
negative values are assigned to unsigned bitfields, provided that the bitfield
is wider than the minimum number of bits needed to encode the negative value.

llvm-svn: 277796
clang/lib/Sema/SemaChecking.cpp
clang/test/Sema/bitfield.c
clang/test/Sema/constant-conversion.c