Handle location wrappers better in warn_logical_operator.
authorJason Merrill <jason@redhat.com>
Mon, 16 Sep 2019 04:34:12 +0000 (00:34 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 16 Sep 2019 04:34:12 +0000 (00:34 -0400)
commitc4438114d6133f4266be57b8678c49badbe60145
tree11acc18cc58f5e10db7a779340e601f933d64b7d
parent27e0979b8b432e5bc109754d4426f49f190b2359
Handle location wrappers better in warn_logical_operator.

When we introduced location wrappers, we added fold_for_warn to warnings
that are interested in a constant value, or wrapper-stripping to warnings
that are interested in literal constants.  This particular warning is
looking for a literal constant, but was wrongly changed to use
fold_for_warn; this patch makes it strip instead.

* c-warn.c (warn_logical_operator): Strip location wrappers.  Don't
fold_for_warn in "|| mask" warning.

From-SVN: r275743
gcc/c-family/ChangeLog
gcc/c-family/c-warn.c