]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Implement P2327R1 - De-deprecating volatile compound operations
authorJakub Jelinek <jakub@redhat.com>
Tue, 16 Aug 2022 11:15:32 +0000 (13:15 +0200)
committerJakub Jelinek <jakub@redhat.com>
Wed, 3 May 2023 11:28:59 +0000 (13:28 +0200)
commitf0ce91c8bb7311b5e98292ee3ae323a24bbe9c09
treed2a142d298fde3acc90d9337100e49658c4ec109
parent408fe10442aa53e2b4573abbf0536aa677c92512
c++: Implement P2327R1 - De-deprecating volatile compound operations

From what I can see, this has been voted in as a DR and as it means
we warn less often than before in -std={gnu,c}++2{0,3} modes or with
-Wvolatile, I wonder if it shouldn't be backported to affected release
branches as well.

2022-08-16  Jakub Jelinek  <jakub@redhat.com>

* typeck.c (cp_build_modify_expr): Implement
P2327R1 - De-deprecating volatile compound operations.  Don't warn
for |=, &= or ^= with volatile lhs.
* expr.c (mark_use) <case MODIFY_EXPR>: Adjust warning wording,
leave out simple.

* g++.dg/cpp2a/volatile1.C: Adjust for de-deprecation of volatile
compound |=, &= and ^= operations.
* g++.dg/cpp2a/volatile3.C: Likewise.
* g++.dg/cpp2a/volatile5.C: Likewise.

(cherry picked from commit 6e790ca4615443fa395ac5cdba1ab6c87810985c)
gcc/cp/expr.c
gcc/cp/typeck.c
gcc/testsuite/g++.dg/cpp2a/volatile1.C
gcc/testsuite/g++.dg/cpp2a/volatile3.C
gcc/testsuite/g++.dg/cpp2a/volatile5.C