{"id":2226784,"url":"http://patchwork.ozlabs.org/api/patches/2226784/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/bmm.hhup55wx16.gcc.gcc-TEST.tkaminsk.85.1.6@forge-stage.sourceware.org/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/projects/17/?format=json","name":"GNU Compiler Collection","link_name":"gcc","list_id":"gcc-patches.gcc.gnu.org","list_email":"gcc-patches@gcc.gnu.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<bmm.hhup55wx16.gcc.gcc-TEST.tkaminsk.85.1.6@forge-stage.sourceware.org>","list_archive_url":null,"date":"2026-04-22T18:49:43","name":"[v1,06/10] More coverage for absence of typedefs and operations","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"95d05546f9ace18ac0b2b7c38c8ce42b4711b11c","submitter":{"id":93223,"url":"http://patchwork.ozlabs.org/api/people/93223/?format=json","name":"tkaminsk via Sourceware Forge","email":"forge-bot+tkaminsk@forge-stage.sourceware.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/bmm.hhup55wx16.gcc.gcc-TEST.tkaminsk.85.1.6@forge-stage.sourceware.org/mbox/","series":[{"id":501094,"url":"http://patchwork.ozlabs.org/api/series/501094/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=501094","date":"2026-04-22T18:49:39","name":"WIP: libstdc++: add support for cv-qualified types in atomic_ref (P3323R1)","version":1,"mbox":"http://patchwork.ozlabs.org/series/501094/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2226784/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2226784/checks/","tags":{},"related":[],"headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g18kh6Hyyz1yGs\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 05:42:20 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 1083940A2C40\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 19:42:17 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 10D61407EE1C\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 18:51:10 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 2936C43595\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 18:51:08 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 1083940A2C40","OpenDKIM Filter v2.11.0 sourceware.org 10D61407EE1C"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 10D61407EE1C","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 10D61407EE1C","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776883870; cv=none;\n b=j3Y2KZ7RvWmCY1JTzyOXFkQN0nObkd4ouLWQPPdRVRyfGnXn55QqUQqaiDaAkkqYEJFCYOQQkO+hWFoLbz5TPU8ItIHqIIxEoX7rm9tuErJ9EFmWoqa4y6g3QuUzrcYrfJpBjCE+SfhSDoaxtppQHihv4mweQtzfjTHtvV2rz6k=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776883870; c=relaxed/simple;\n bh=qOhLcSY25dKSa5j9TwF19Gv6dWsj5thnrr1oOPeCqpc=;\n h=From:Date:Subject:MIME-Version:To:Message-ID;\n b=pSitscm9kLLEhC8eEFcBLvpK+XoHY+ihlHSdYu5t1rFaqLIFs02OF3DjdIgo9TOLjrybAsvEzYfVC050Brm5QIVuPaFumizs9IHzb+BnbVec5lrOsrM/pU9oKnNwEIatCjZTb2uVrdr3RK4oVm92B0wJNVu7ufUi/GDrwplJja0=","ARC-Authentication-Results":"i=1; server2.sourceware.org","From":"tkaminsk via Sourceware Forge\n <forge-bot+tkaminsk@forge-stage.sourceware.org>","Date":"Wed, 22 Apr 2026 18:49:43 +0000","Subject":"[PATCH v1 06/10] More coverage for absence of typedefs and operations","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Message-ID":"\n <bmm.hhup55wx16.gcc.gcc-TEST.tkaminsk.85.1.6@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/85","References":"\n <bmm.hhup55wx16.gcc.gcc-TEST.tkaminsk.85.1.0@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhup55wx16.gcc.gcc-TEST.tkaminsk.85.1.0@forge-stage.sourceware.org>","X-Patch-URL":"\n https://forge.sourceware.org/tkaminsk/gcc/commit/1e9f21be5f755f180b688e266bb8ae45afe72cb4","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Reply-To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>,\n tkaminsk@gcc.gnu.org","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"},"content":"From: Tomasz Kamiński <tkaminsk@redhat.com>\n\n---\n .../testsuite/29_atomics/atomic_ref/bool.cc   |  33 -----\n .../29_atomics/atomic_ref/op_support.cc       | 113 ++++++++++++++++++\n .../29_atomics/atomic_ref/requirements.cc     |   6 +-\n 3 files changed, 115 insertions(+), 37 deletions(-)\n delete mode 100644 libstdc++-v3/testsuite/29_atomics/atomic_ref/bool.cc\n create mode 100644 libstdc++-v3/testsuite/29_atomics/atomic_ref/op_support.cc","diff":"diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_ref/bool.cc b/libstdc++-v3/testsuite/29_atomics/atomic_ref/bool.cc\ndeleted file mode 100644\nindex 7b362737afba..000000000000\n--- a/libstdc++-v3/testsuite/29_atomics/atomic_ref/bool.cc\n+++ /dev/null\n@@ -1,33 +0,0 @@\n-// { dg-do compile { target c++20 } }\n-\n-#include <atomic>\n-\n-template<class T> concept has_and = requires (T& a) { a &= false; };\n-template<class T> concept has_or = requires (T& a) { a |= false; };\n-template<class T> concept has_xor = requires (T& a) { a ^= false; };\n-template<class T> concept has_fetch_add = requires (T& a) { a.fetch_add(true); };\n-template<class T> concept has_fetch_sub = requires (T& a) { a.fetch_sub(true); };\n-\n-static_assert( not has_and<std::atomic_ref<bool>> );\n-static_assert( not has_or<std::atomic_ref<bool>> );\n-static_assert( not has_xor<std::atomic_ref<bool>> );\n-static_assert( not has_fetch_add<std::atomic_ref<bool>> );\n-static_assert( not has_fetch_sub<std::atomic_ref<bool>> );\n-\n-static_assert( not has_and<std::atomic_ref<const bool>> );\n-static_assert( not has_or<std::atomic_ref<const bool>> );\n-static_assert( not has_xor<std::atomic_ref<const bool>> );\n-static_assert( not has_fetch_add<std::atomic_ref<const bool>> );\n-static_assert( not has_fetch_sub<std::atomic_ref<const bool>> );\n-\n-static_assert( not has_and<std::atomic_ref<volatile bool>> );\n-static_assert( not has_or<std::atomic_ref<volatile bool>> );\n-static_assert( not has_xor<std::atomic_ref<volatile bool>> );\n-static_assert( not has_fetch_add<std::atomic_ref<volatile bool>> );\n-static_assert( not has_fetch_sub<std::atomic_ref<volatile bool>> );\n-\n-static_assert( not has_and<std::atomic_ref<const volatile bool>> );\n-static_assert( not has_or<std::atomic_ref<const volatile bool>> );\n-static_assert( not has_xor<std::atomic_ref<const volatile bool>> );\n-static_assert( not has_fetch_add<std::atomic_ref<const volatile bool>> );\n-static_assert( not has_fetch_sub<std::atomic_ref<const volatile bool>> );\ndiff --git a/libstdc++-v3/testsuite/29_atomics/atomic_ref/op_support.cc b/libstdc++-v3/testsuite/29_atomics/atomic_ref/op_support.cc\nnew file mode 100644\nindex 000000000000..8865345a0416\n--- /dev/null\n+++ b/libstdc++-v3/testsuite/29_atomics/atomic_ref/op_support.cc\n@@ -0,0 +1,113 @@\n+// { dg-do compile { target c++20 } }\n+\n+#include <atomic>\n+\n+template<class T> concept has_and = requires (T& a) { a &= false; };\n+template<class T> concept has_or = requires (T& a) { a |= false; };\n+template<class T> concept has_xor = requires (T& a) { a ^= false; };\n+template<class T> concept has_fetch_add = requires (T& a) { a.fetch_add(true); };\n+template<class T> concept has_fetch_sub = requires (T& a) { a.fetch_sub(true); };\n+\n+static constexpr std::memory_order mo = std::memory_order_seq_cst;\n+\n+#define HAS(op) (requires (std::atomic_ref<T> a, T t) { op; })\n+\n+template<typename T>\n+void\n+no_stores()\n+{\n+  static_assert( !HAS(a = t) );\n+  static_assert( !HAS(a.store(t)) );\n+  static_assert( !HAS(a.store(t, mo)) );\n+  static_assert( !HAS(a.exchange(t)) );\n+  static_assert( !HAS(a.exchange(t, mo)) );\n+\n+  static_assert( !HAS(a.compare_exchange_weak(t, t)) );\n+  static_assert( !HAS(a.compare_exchange_weak(t, t, mo)) );\n+  static_assert( !HAS(a.compare_exchange_weak(t, t, mo, mo)) );\n+\n+  static_assert( !HAS(a.compare_exchange_strong(t, t)) );\n+  static_assert( !HAS(a.compare_exchange_strong(t, t, mo)) );\n+  static_assert( !HAS(a.compare_exchange_strong(t, t, mo, mo)) );\n+}\n+\n+template<typename T>\n+void\n+no_additions()\n+{\n+  static_assert( !HAS(a++) );\n+  static_assert( !HAS(++a) );\n+  static_assert( !HAS(a += t) );\n+  static_assert( !HAS(a.fetch_add(t)) );\n+  static_assert( !HAS(a.fetch_add(t, mo)) );\n+\n+  static_assert( !HAS(a--) );\n+  static_assert( !HAS(--a) );\n+  static_assert( !HAS(a -= t) );\n+  static_assert( !HAS(a.fetch_sub(t)) );\n+  static_assert( !HAS(a.fetch_sub(t, mo)) );\n+}\n+\n+template<typename T>\n+void\n+no_bitops()\n+{\n+  static_assert( !HAS(a &= t) );\n+  static_assert( !HAS(a.fetch_and(t)) );\n+  static_assert( !HAS(a.fetch_and(t, mo)) );\n+\n+  static_assert( !HAS(a |= t) );\n+  static_assert( !HAS(a.fetch_or(t)) );\n+  static_assert( !HAS(a.fetch_or(t, mo)) );\n+\n+  static_assert( !HAS(a ^= t) );\n+  static_assert( !HAS(a.fetch_xor(t)) );\n+  static_assert( !HAS(a.fetch_xor(t, mo)) );\n+}\n+\n+template<typename T>\n+void\n+no_math()\n+{\n+  no_additions<T>();\n+  no_bitops<T>();\n+}\n+\n+template<typename T>\n+void\n+no_mutations()\n+{\n+  no_stores<T>();\n+  no_math<T>();\n+}\n+\n+struct S\n+{\n+  int x;\n+  int y;\n+};\n+\n+int main() \n+{\n+  no_mutations<const int>();\n+  no_mutations<const volatile int>();\n+  \n+  no_bitops<float>();\n+  no_bitops<volatile float>();\n+  no_mutations<const float>();\n+\n+  no_bitops<int*>();\n+  no_bitops<int* volatile>();\n+  no_mutations<int* const>();\n+  no_mutations<int* const volatile>();\n+\n+  no_math<bool>();\n+  no_math<volatile bool>();\n+  no_mutations<const bool>();\n+  no_mutations<const volatile bool>();\n+\n+  no_math<S>();\n+  no_math<volatile S>();\n+  no_mutations<const S>();\n+  no_mutations<const volatile S>();\n+}\ndiff --git a/libstdc++-v3/testsuite/29_atomics/atomic_ref/requirements.cc b/libstdc++-v3/testsuite/29_atomics/atomic_ref/requirements.cc\nindex e7bb29b0aa63..8617661f8e13 100644\n--- a/libstdc++-v3/testsuite/29_atomics/atomic_ref/requirements.cc\n+++ b/libstdc++-v3/testsuite/29_atomics/atomic_ref/requirements.cc\n@@ -29,6 +29,7 @@ test_generic()\n   static_assert( std::is_nothrow_copy_constructible_v<A> );\n   static_assert( std::is_trivially_destructible_v<A> );\n   static_assert( std::is_same_v<typename A::value_type, std::remove_cv_t<T>> );\n+  static_assert( !requires { typename A::difference_type; } );\n   static_assert( !std::is_copy_assignable_v<A> );\n   static_assert( !std::is_move_assignable_v<A> );\n }\n@@ -37,7 +38,6 @@ template <class T>\n void\n test_integral()\n {\n-  static_assert( std::is_integral_v<T> );\n   using A = std::atomic_ref<T>;\n   static_assert( std::is_standard_layout_v<A> );\n   static_assert( std::is_nothrow_copy_constructible_v<A> );\n@@ -52,7 +52,6 @@ template <class T>\n void\n test_floating_point()\n {\n-  static_assert( std::is_floating_point_v<T> );\n   using A = std::atomic_ref<T>;\n   static_assert( std::is_standard_layout_v<A> );\n   static_assert( std::is_nothrow_copy_constructible_v<A> );\n@@ -67,7 +66,6 @@ template <class T>\n void\n test_pointer()\n {\n-  static_assert( std::is_pointer_v<T> );\n   using A = std::atomic_ref<T>;\n   static_assert( std::is_standard_layout_v<A> );\n   static_assert( std::is_nothrow_copy_constructible_v<A> );\n@@ -108,4 +106,4 @@ main()\n   test_pointer<int* const>();\n   test_pointer<int* volatile>();\n   test_pointer<int* const volatile>();\n-}\n\\ No newline at end of file\n+}\n","prefixes":["v1","06/10"]}