]> granicus.if.org Git - clang/commit
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)
commita9a97905f0cafad077280e1e49b35126fd3a3a7b
tree59e7f142ca27b8efce40cc93403b1237934dc552
parentcab7b600139f46adb9b1dd553da3c941c2bf8e13
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277796 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaChecking.cpp
test/Sema/bitfield.c
test/Sema/constant-conversion.c