re PR c/34389 (-Wconversion produces wrong warning)
authorManuel López-Ibáñez <manu@gcc.gnu.org>
Wed, 30 Jul 2008 08:30:32 +0000 (08:30 +0000)
committerManuel López-Ibáñez <manu@gcc.gnu.org>
Wed, 30 Jul 2008 08:30:32 +0000 (08:30 +0000)
commit6715192c06501e2bc1ee1a2670697dbe5d0efd41
tree9f9fa0bd313bb28619e5203904c17f871a84a669
parent473e10621f06ef6cfd82f3875224c4b82c2eb7cf
re PR c/34389 (-Wconversion produces wrong warning)

2008-07-30  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

PR 34389
* c-typeck.c (build_binary_op): Encapsulate code into...
* c-common.c (shorten_binary_op): ...this new function.
(conversion_warning): Use the new function. Handle non-negative
constant in bitwise-and.
* c-common.h (shorten_binary_op): Declare.
cp/
* typeck.c (build_binary_op): Encapsulate code into
shorten_binary_op.
testsuite/
* gcc.dg/Wconversion-pr34389.c: New.
* g++.dg/warn/Wconversion-pr34389.C: New.

From-SVN: r138296
gcc/ChangeLog
gcc/c-common.c
gcc/c-common.h
gcc/c-typeck.c
gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/Wconversion-pr34389.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wconversion-pr34389.c [new file with mode: 0644]