This is the mail archive of the
mailing list for the GCC project.
Re: [C++ PATCH] Adjust -Wsequence-point for C++17 changes (PR c++/91415)
- From: Jeff Law <law at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>, Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 12 Aug 2019 14:05:06 -0600
- Subject: Re: [C++ PATCH] Adjust -Wsequence-point for C++17 changes (PR c++/91415)
- References: <20190812144831.GP2726@tucnak>
On 8/12/19 8:48 AM, Jakub Jelinek wrote:
> The following patch adds some tweaks for -Wsequence-point warning for C++17
> and later. In particular, stop warning about no sequence point in between
> <<, >>, ., -> and  expressions, where E1 is in C++17 sequenced before E2.
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
> As mentioned in the PR, this is just part of the needed changes, I've tried
> to adjust handling of MODIFY_EXPR, but didn't figure out exactly what needs
> to be done, and .* / ->* aren't handled either, and CALL_EXPR needs probably
> some verification too.
> 2019-08-12 Jakub Jelinek <email@example.com>
> PR c++/91415
> * c-common.c (verify_tree): For LSHIFT_EXPR, RSHIFT_EXPR,
> COMPONENT_REF and ARRAY_REF in cxx_dialect >= cxx17 mode handle it
> like COMPOUND_EXPR rather than normal expression.
> * g++.dg/warn/sequence-pt-4.C: New test.