Do constant folding in warn_* functions.
authorJason Merrill <jason@redhat.com>
Wed, 2 Dec 2015 19:04:48 +0000 (14:04 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 2 Dec 2015 19:04:48 +0000 (14:04 -0500)
commitf479b43da091fd3ede525b7832cd69a22fb49f9a
treea2673f4d1a0faba8a3681800dd902ffc2694cc6f
parent7426fcc84f6e0a410139f60778d8d1c1d32d0283
Do constant folding in warn_* functions.

gcc/c-family/
* c-common.c (fold_for_warn): New.
(warn_logical_operator, warn_tautological_cmp)
(check_function_arguments_recurse, maybe_warn_bool_compare): Use it.
gcc/cp/
* call.c (build_new_op_1): Don't fold arguments to
warn_logical_operator or maybe_warn_bool_compare.

From-SVN: r231198
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/testsuite/g++.dg/warn/Wnonnull1.C [new file with mode: 0644]