diff options
author | Patrick Palka <ppalka@redhat.com> | 2024-07-17 20:57:54 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2024-07-17 20:57:54 -0400 |
commit | 144b6099cdaa9ac1b298687c0cfdb06a970e338b (patch) | |
tree | 4b893361f04c94d02c8977459bf20dc1c70a07ac /libbacktrace/print.c | |
parent | 313afcfdabeab3e6705ac0bd1273627075be0023 (diff) | |
download | gcc-144b6099cdaa9ac1b298687c0cfdb06a970e338b.zip gcc-144b6099cdaa9ac1b298687c0cfdb06a970e338b.tar.gz gcc-144b6099cdaa9ac1b298687c0cfdb06a970e338b.tar.bz2 |
c++: missing -Wunused-value for !<expr> [PR114104]
Here we're neglecting to issue a -Wunused-value warning for suitable !
operator expressions, and in turn for != operator expressions that are
rewritten as !(x == y), only because we don't call warn_if_unused_value
on TRUTH_NOT_EXPR since its class is tcc_expression. This patch makes
us also consider warning for TRUTH_NOT_EXPR and also for ADDR_EXPR.
PR c++/114104
gcc/cp/ChangeLog:
* cvt.cc (convert_to_void): Call warn_if_unused_value for
TRUTH_NOT_EXPR and ADDR_EXPR as well.
gcc/testsuite/ChangeLog:
* g++.dg/warn/Wunused-20.C: New test.
Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'libbacktrace/print.c')
0 files changed, 0 insertions, 0 deletions