]> git.ipfire.org Git - thirdparty/gcc.git/commit
c-family: -Wsequence-point and COMPONENT_REF [PR107163]
authorJason Merrill <jason@redhat.com>
Thu, 23 Mar 2023 19:57:39 +0000 (15:57 -0400)
committerJason Merrill <jason@redhat.com>
Tue, 18 Apr 2023 20:44:28 +0000 (16:44 -0400)
commitdcfa9615062c46f3c45c70654ea8fa6719a5f40c
tree189b3dd05d2c63ae70c2e9e5348762a354e97449
parentab7c0a44ca9e913af654ae82963565d61d8bb39f
c-family: -Wsequence-point and COMPONENT_REF [PR107163]

The patch for PR91415 fixed -Wsequence-point to treat shifts and ARRAY_REF
as sequenced in C++17, and COMPONENT_REF as well.  But this is unnecessary
for COMPONENT_REF, since the RHS is just a FIELD_DECL with no actual
evaluation, and in this testcase handling COMPONENT_REF as sequenced blows
up fast in a deep inheritance tree.  Instead, look through it.

PR c++/107163

gcc/c-family/ChangeLog:

* c-common.cc (verify_tree): Don't use sequenced handling
for COMPONENT_REF.

gcc/testsuite/ChangeLog:

* g++.dg/warn/Wsequence-point-5.C: New test.
gcc/c-family/c-common.cc
gcc/testsuite/g++.dg/warn/Wsequence-point-5.C [new file with mode: 0644]