]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/c-family/c-common.c
PR c++/62153
authormpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 Aug 2014 18:50:00 +0000 (18:50 +0000)
committermpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 Aug 2014 18:50:00 +0000 (18:50 +0000)
commit78bf41568c66b61419865b36f101121c8f5918a5
treec01c9d77dc28f6a4d017760a2f0f57809574d010
parentdec0d4e18a3d88a552b6b01c1900053519aed20a
PR c++/62153
* doc/invoke.texi: Document -Wbool-compare.
c-family/
* c-common.c (maybe_warn_bool_compare): New function.
* c-common.h (maybe_warn_bool_compare): Declare.
* c.opt (Wbool-compare): New option.
c/
* c-typeck.c (build_binary_op): If either operand of a comparison
is a boolean expression, call maybe_warn_bool_compare.
cp/
* call.c (build_new_op_1): Remember the type of arguments for
a comparison.  If either operand of a comparison is a boolean
expression, call maybe_warn_bool_compare.
testsuite/
* c-c++-common/Wbool-compare-1.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214183 138bc75d-0d04-0410-961f-82ee72b054a4
12 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-common.h
gcc/c-family/c.opt
gcc/c/ChangeLog
gcc/c/c-typeck.c
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/Wbool-compare-1.c [new file with mode: 0644]