c-common.c (c_common_truthvalue_conversion): When warning about using an assignment...
commitfbc8d2d30e4c1987e85e2d3fda043f2ae24c7ad1
authorIan Lance Taylor <iant@google.com>
Tue, 2 Jan 2007 17:49:07 +0000 (2 17:49 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 2 Jan 2007 17:49:07 +0000 (2 17:49 +0000)
tree8c417c46fb300ca0e55218e9d49e86f6e77ea715
parentb1ed4cb43c9b43a57b28d35c46062607af6e6a64
c-common.c (c_common_truthvalue_conversion): When warning about using an assignment as a truth value, set TREE_NO_WARNING.

./: * c-common.c (c_common_truthvalue_conversion): When warning about
using an assignment as a truth value, set TREE_NO_WARNING.
cp/:
* semantics.c (maybe_convert_cond): Optionally warn when using an
assignment as a condition.
* typeck.c (convert_for_assignment): Optionally warn about
assigning the result of an assignment to a bool.
testsuite/:
* g++.dg/warn/Wparentheses-22.C: New test.
* g++.dg/warn/Wparentheses-23.C: New test.

From-SVN: r120348
gcc/ChangeLog
gcc/c-common.c
gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/Wparentheses-22.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wparentheses-23.C [new file with mode: 0644]