re PR c++/86569 (-Wnonnull-compare affects code generation since r233684)
authorJakub Jelinek <jakub@redhat.com>
Mon, 23 Jul 2018 07:48:56 +0000 (09:48 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 23 Jul 2018 07:48:56 +0000 (09:48 +0200)
commit315aa691f486bfe71bae0a5fc8828db26daebb56
tree6c1df506f9a1846bd981daed7c17c39dec0df523
parentd9690d237cf5d195322e2ebbd29f13b1273ecc68
re PR c++/86569 (-Wnonnull-compare affects code generation since r233684)

PR c++/86569
* cp-gimplify.c (cp_fold): Don't fold comparisons into other kind
of expressions other than INTEGER_CST regardless of TREE_NO_WARNING
or warn_nonnull_compare.

* g++.dg/warn/Wnonnull-compare-9.C: New test.

From-SVN: r262928
gcc/cp/ChangeLog
gcc/cp/cp-gimplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/Wnonnull-compare-9.C [new file with mode: 0644]