On Fri, 22 May 2026 at 00:41, Jonathan Wakely <[email protected]> wrote:
>
> This implements P3475R2, "Defang and deprecate memory_order::consume",
> approved in Hagenberg, 2025.
>
> It looks like the using-declaration for memory_order_consume in
> <stdatomic.h> was not deprecated by the paper, but I don't think we can
> implement that if we warn for the name in <atomic>. It doesn't make
> sense to me for it to be deprecated in C++ but still usable in the C/C++
> compatibility header. It's still just as useless in common C/C++
> headers, so we should warn.

Linaro's CI pointed out this causes two g++ test regressions:

FAIL: g++.dg/warn/Winvalid-memory-model-2.C -std=gnu++26 (test for
excess errors)
FAIL: g++.dg/warn/Winvalid-memory-model.C -std=gnu++26 (test for excess errors)

So the patch additionally needs:

gcc/testsuite/ChangeLog:

       * g++.dg/warn/Winvalid-memory-model-2.C: Disable deprecated
       warnings for C++26 and up.
       * g++.dg/warn/Winvalid-memory-model.C: Likewise.

diff --git a/gcc/testsuite/g++.dg/warn/Winvalid-memory-model-2.C
b/gcc/testsuite/g++.dg/warn/Winvalid-memory-model-2.C
index a15706159aaf..05d5c4eda21d 100644
--- a/gcc/testsuite/g++.dg/warn/Winvalid-memory-model-2.C
+++ b/gcc/testsuite/g++.dg/warn/Winvalid-memory-model-2.C
@@ -2,7 +2,8 @@
   -Wsystem-headers
   Verify warnings for atomic functions with optimization.
   { dg-do compile { target c++11 } }
-   { dg-options "-O1" } */
+   { dg-options "-O1" }
+   { dg-additional-options "-Wno-deprecated-declarations" { target c++26 } } */

#include <atomic>

diff --git a/gcc/testsuite/g++.dg/warn/Winvalid-memory-model.C
b/gcc/testsuite/g++.dg/warn/Winvalid-memory-model.C
index 0ef2c75dee76..509ce280534c 100644
--- a/gcc/testsuite/g++.dg/warn/Winvalid-memory-model.C
+++ b/gcc/testsuite/g++.dg/warn/Winvalid-memory-model.C
@@ -2,7 +2,8 @@
   -Wsystem-headers
   Verify warnings for basic atomic functions with no optimization.
   { dg-do compile { target c++11 } }
-   { dg-options "-O0 -Wall" } */
+   { dg-options "-O0 -Wall" }
+   { dg-additional-options "-Wno-deprecated-declarations" { target c++26 } } */

#include <atomic>

Reply via email to