re PR c/48418 (Bit shift operator >>=)
authorJakub Jelinek <jakub@redhat.com>
Wed, 9 Jan 2013 14:51:09 +0000 (15:51 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 9 Jan 2013 14:51:09 +0000 (15:51 +0100)
commitcc83c823a2be3dc48f011c07c9e407af0a7974c0
tree9860db1553f003a5d248886e9631536f697cf020
parentfdbff37f390c9bb60794be943acb898159717834
re PR c/48418 (Bit shift operator >>=)

PR c/48418
* c-common.c (c_fully_fold_internal): Warn for LSHIFT_EXPR and
RSHIFT_EXPR, if orig_op1 isn't INTEGER_CST, op1 is INTEGER_CST
and is either negative or bigger or equal to type precision
of the first operand.

* typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
call maybe_constant_value for the negative or too big shift
count warnings.

* c-c++-common/pr48418.c: New test.

From-SVN: r195051
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/pr48418.c [new file with mode: 0644]