Allow casting to a restricted type if !restricted_value
commita9432b3336e8e584c85ed8a03535aa7564e93514
authorEdward Cree <ecree@solarflare.com>
Tue, 21 Feb 2017 12:22:18 +0000 (21 12:22 +0000)
committerChristopher Li <sparse@chrisli.org>
Fri, 3 Mar 2017 16:45:38 +0000 (4 00:45 +0800)
tree92933fde8dffd41ac577d73aad972db1eb51843d
parent0dfda0d1f0fe672c5aabdaf67665ec9b5aeaa4ac
Allow casting to a restricted type if !restricted_value

If the operand of a cast to a restricted type is an unrestricted value,
 the cast should not produce a warning, since an equivalent implied cast
 (e.g. in an initialiser) would not do so.

Also adds a test case (bitwise-cast.c) testing implicit and explicit
 conversions of zero and nonzero integers to bitwise type.

Signed-off-by: Edward Cree <ecree@solarflare.com>
Acked-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Tested-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
evaluate.c
validation/bitwise-cast.c [new file with mode: 0644]