diff options
author | Marek Polacek <polacek@redhat.com> | 2023-01-19 17:12:34 -0500 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2023-01-23 16:41:48 -0500 |
commit | e3585e6acdfd5c1793f877476647d2521620c95c (patch) | |
tree | be03840369b1fc4e087b3b97fed693bce71e861d /gcc/config | |
parent | 72e46b3c7ad5e3d2c69868a510c00707c356106a (diff) | |
download | gcc-e3585e6acdfd5c1793f877476647d2521620c95c.zip gcc-e3585e6acdfd5c1793f877476647d2521620c95c.tar.gz gcc-e3585e6acdfd5c1793f877476647d2521620c95c.tar.bz2 |
c++: Quash bogus -Wunused-value with new [PR107797]
We shouldn't emit "right operand of comma operator has no effect"
when that comma operator was created by the compiler for "new int{}".
convert_to_void/COMPOUND_EXPR already checks warning_suppressed_p so
we can just suppress -Wunused-value.
PR c++/107797
gcc/cp/ChangeLog:
* cvt.cc (ocp_convert): copy_warning when creating a new
COMPOUND_EXPR.
* init.cc (build_new_1): Suppress -Wunused-value on
compiler-generated COMPOUND_EXPRs.
gcc/testsuite/ChangeLog:
* g++.dg/warn/Wunused-value-1.C: New test.
Diffstat (limited to 'gcc/config')
0 files changed, 0 insertions, 0 deletions