]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: bogus -Wparentheses warning [PR112765]
authorPatrick Palka <ppalka@redhat.com>
Wed, 29 Nov 2023 21:42:39 +0000 (16:42 -0500)
committerPatrick Palka <ppalka@redhat.com>
Wed, 29 Nov 2023 21:42:39 +0000 (16:42 -0500)
commit220fe41fd4085e91a49e62dd815628ec4883a4ea
tree1ff5000bf39cd5717ccdb59c507f4f399ecc6280
parent72e212c0290b70a7a87fbec58444787f1b177847
c++: bogus -Wparentheses warning [PR112765]

We need to consistently look through implicit INDIRECT_REF when
setting/checking for -Wparentheses warning suppression.  In passing
use the recently introduced STRIP_REFERENCE_REF helper some more.

PR c++/112765

gcc/cp/ChangeLog:

* pt.cc (tsubst_expr) <case MODOP_EXPR>: Look through implicit
INDIRECT_REF when propagating -Wparentheses warning suppression.
* semantics.cc (maybe_warn_unparenthesized_assignment): Replace
REFERENCE_REF_P handling with STRIP_REFERENCE_REF.
(finish_parenthesized_expr): Likewise.

gcc/testsuite/ChangeLog:

* g++.dg/warn/Wparentheses-33.C: New test.
gcc/cp/pt.cc
gcc/cp/semantics.cc
gcc/testsuite/g++.dg/warn/Wparentheses-33.C [new file with mode: 0644]