[Bug c/65120] [5 Regression] Wlogical-not-parentheses should not warn about double exclamation !!

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Mar 10 06:39:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65120

--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Tue Mar 10 06:38:57 2015
New Revision: 221299

URL: https://gcc.gnu.org/viewcvs?rev=221299&root=gcc&view=rev
Log:
    PR c/65120
    * c-common.c (warn_logical_not_parentheses): Don't warn for
    !x == 0 or !x != 0.

    * c-typeck.c (parser_build_binary_op): Check for tcc_comparison
    before preparing arguments to warn_logical_not_parentheses.

    * parser.c (cp_parser_binary_expression): Check for tcc_comparison
    before preparing arguments to warn_logical_not_parentheses.
    Use maybe_constant_value on rhs.

    * c-c++-common/pr49706.c (fn2): Don't expect warning if enumerator
    on rhs is 0.
    (fn4): New test.
    * c-c++-common/pr65120.c: New test.

Added:
    trunk/gcc/testsuite/c-c++-common/pr65120.c
Modified:
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-common.c
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-typeck.c
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/c-c++-common/pr49706.c



More information about the Gcc-bugs mailing list