Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2233041/?format=api
{ "id": 2233041, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2233041/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260505151030.1749548-10-waffl3x@baylibre.com/", "project": { "id": 17, "url": "http://patchwork.ozlabs.org/api/1.2/projects/17/?format=api", "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": "<20260505151030.1749548-10-waffl3x@baylibre.com>", "list_archive_url": null, "date": "2026-05-05T15:02:02", "name": "[09/12] OpenMP/C++: Diagnose constexpr vars in an allocate directive", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "baf14419bbb30a6cde6385e1e630be9b865e26c6", "submitter": { "id": 90070, "url": "http://patchwork.ozlabs.org/api/1.2/people/90070/?format=api", "name": "Waffl3x", "email": "waffl3x@baylibre.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260505151030.1749548-10-waffl3x@baylibre.com/mbox/", "series": [ { "id": 502853, "url": "http://patchwork.ozlabs.org/api/1.2/series/502853/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=502853", "date": "2026-05-05T15:01:54", "name": "OpenMP/C++: 'allocate' directive", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/502853/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2233041/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2233041/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\tdkim=pass (2048-bit key;\n unprotected) header.d=baylibre-com.20251104.gappssmtp.com\n header.i=@baylibre-com.20251104.gappssmtp.com header.a=rsa-sha256\n header.s=20251104 header.b=vwhuTA46;\n\tdkim-atps=neutral", "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;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=baylibre-com.20251104.gappssmtp.com\n header.i=@baylibre-com.20251104.gappssmtp.com header.a=rsa-sha256\n header.s=20251104 header.b=vwhuTA46", "sourceware.org;\n dmarc=none (p=none dis=none) header.from=baylibre.com", "sourceware.org; spf=pass smtp.mailfrom=baylibre.com", "server2.sourceware.org;\n arc=none smtp.remote-ip=2607:f8b0:4864:20::431" ], "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 4g927w0wKCz1yJ0\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 06 May 2026 01:13:00 +1000 (AEST)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 264054BA9030\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 5 May 2026 15:12:58 +0000 (GMT)", "from mail-pf1-x431.google.com (mail-pf1-x431.google.com\n [IPv6:2607:f8b0:4864:20::431])\n by sourceware.org (Postfix) with ESMTPS id 030504BA901A\n for <gcc-patches@gcc.gnu.org>; Tue, 5 May 2026 15:10:46 +0000 (GMT)", "by mail-pf1-x431.google.com with SMTP id\n d2e1a72fcca58-826dab01bbdso200988b3a.0\n for <gcc-patches@gcc.gnu.org>; Tue, 05 May 2026 08:10:45 -0700 (PDT)", "from waffl3x-prestige.lan ([2001:56a:f98a:b800:1f67:ce08:3cbd:86b8])\n by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-83965645140sm2674956b3a.12.2026.05.05.08.10.44\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 05 May 2026 08:10:44 -0700 (PDT)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 264054BA9030", "OpenDKIM Filter v2.11.0 sourceware.org 030504BA901A" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 030504BA901A", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 030504BA901A", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777993846; cv=none;\n b=LsQUVoYbwft7h8H5M9GpRXZJMTwhYql3whhYvJjCAKLo2V2Bkd8PYVM6r98eRMWAeJSlPJbrdxPUwvIr2gKYNYqPOTl9oWqwLik1gda3ANU3Yd1MAflfI5VH3NZLs9v6l5whh7AJVP0VUbtM8XqoAA7I47cDvjHEIPLNyhZIDPg=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777993846; c=relaxed/simple;\n bh=owiihx2aBzcxi4dNoVGtPUGDF0a6V4YiYZnRdJ/ASiA=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=HXSJjzXwQB0v9NrgOCJYZgDZs/H448Bu8vzRlXtPtHd//AUf+KeFGuHgHOBpaxUrpvzI9BdRAkfantEbGm1asXX3wgzSpjsgKAu7R4e0k9XvGZ6QguT/X9vIh5CFFvBAkuNAQK9icHmilNNABwXfRhnohAvJNBUl3FqpijO7Z1s=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=baylibre-com.20251104.gappssmtp.com; s=20251104; t=1777993845;\n x=1778598645;\n darn=gcc.gnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=WF/GxCbpS3643tblFf06FOxBdfv6sIDbnPId+JYHRlk=;\n b=vwhuTA46qCVYYL9K7S57iDMAeP27S1lx6vtHvvcrwjblX5pNJUBVUEicSJ+A1tKR+n\n ljtuQBTJweR1j61xVpBM2fR0d3FMKDufs27QSlQuM1bfibflcj91ozaA/puj/iLRiPJ7\n pGIJZgFBl41faqLbEqswPZj1KyMHmRcSlCcUa9DGnHv8GJzdbvofbbNUd9YyH2MzlG+o\n kgxQBzVZn7NZtJU2D6TZc0oYd+SlhmXmZJDq+lmDCOWgiU4wSx2wKa8a6cSCoE84dc4t\n MPrOw5ajBluu84XCi8EP4T0lefFioStjFDliTFDPVFeahoOQdKAJ/D+qlPgH5MzXuv/N\n nYnw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777993845; x=1778598645;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=WF/GxCbpS3643tblFf06FOxBdfv6sIDbnPId+JYHRlk=;\n b=D2jIxCn2BsSW22BzNExDzogk73cOeB7Y2eplvnOwaTmM1pGEEuHWGQTseCZk3Jjo7l\n 71nl22XqazvgA1StJEDw/8UXHXAZ0DL/Ijy36kOhmfDxdihJ6bMKkNUG2qacWzdkr8KN\n aRihvrBLZB7ERu6FAzwOHL9W7qbimVyntLybIO1TEoRV4uKfomacvoyXdCaTa9lxFW8p\n DyrCmf/96bv+v81R7/+CY3LE38FiJZHAD/9bGkiFteWnb8i6fe3D9LPbOC5/EQMm8J+C\n y+m5oR0hC23YpQAmzPve+zYhJe/sTGhLRDyXql1OtZ0BJyOVGkmez8ZF67RniD8OjOCB\n EQOg==", "X-Gm-Message-State": "AOJu0YwxRluggUuTeNBOUGZmf5hAMg6r1a8ITAD+MJxBO4uz5BC/n0kt\n R9/D1lncCzUKSPT97u1RP2uHN3+iEG1aAKtGqQgTMZI0I9YiTI2oiAhvlV1pBVDOMX+OJ3gB4t4\n QP/Y6", "X-Gm-Gg": "AeBDievluv/UUPX4BFlY4tU01AYO0geRV3IJhBhhNs9ljIFK2VqXmgT9H+AQHB3LOSJ\n 4+kfjY1FMZ+ELjCHpfCuJIkjApvNsX6TlO0JZ3PaWY0HfjwXQIQAbZ/6lfpeFoE/0xweaQWHxv+\n +UXmO8wkshfm9elMTzBs59OD/k32B/U+hibOBy2nhqtmwqrSAHF4wCNg83puntbyx1YmBP9zkKX\n 3I91VH8sycSfaJETslf2jmL0tLJpu51S0jqnuSxa4qCYmjJIxyvtFUlWBVGIunt9pcJIjNWLOwb\n dV5NPVl7hpXSuZspkUG+YcTXmyU12mMgFUhVXHRnZIfjAcsMEaRbUsS/CQJ8isDVM6AtmQoDNDW\n UZVj9p5OKk0QOX6zPx6ycvilyEjZrGEYO7ZdiK8qVpHx0gEGqPVwwfCgeI88Dhp1AGPDWm3NnM9\n ISm592qoYLAgWDHKOCbKInXhATcU6PItVRT3qEpzRNxpj+fUDeKw==", "X-Received": "by 2002:a05:6a00:e08:b0:834:dfb5:6e7f with SMTP id\n d2e1a72fcca58-8393bbf2e19mr1596698b3a.2.1777993844973;\n Tue, 05 May 2026 08:10:44 -0700 (PDT)", "From": "Waffl3x <waffl3x@baylibre.com>", "To": "gcc-patches@gcc.gnu.org", "Cc": "Waffl3x <waffl3x@baylibre.com>", "Subject": "[PATCH 09/12] OpenMP/C++: Diagnose constexpr vars in an allocate\n directive", "Date": "Tue, 5 May 2026 09:02:02 -0600", "Message-ID": "<20260505151030.1749548-10-waffl3x@baylibre.com>", "X-Mailer": "git-send-email 2.54.0", "In-Reply-To": "<20260505151030.1749548-1-waffl3x@baylibre.com>", "References": "\n <CAH+W3Ppbho4pj6W-rWk4mMssrttOjt7aNco-oWW5Sw5f5Yx2GA@mail.gmail.com>\n <20260505151030.1749548-1-waffl3x@baylibre.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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>", "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org" }, "content": "It is unclear whether this should be allowed or not. For now, diagnose it\nuntil one can come up with a compelling reason to allow it.\n\ngcc/cp/ChangeLog:\n\n\t* parser.cc (cp_parser_omp_allocate): Add diagnostics.\n\ngcc/testsuite/ChangeLog:\n\n\t* g++.dg/gomp/allocate-15.C: Add cases.\n\nSigned-off-by: Waffl3x <waffl3x@baylibre.com>\n---\n gcc/cp/parser.cc | 13 ++++++++\n gcc/testsuite/g++.dg/gomp/allocate-15.C | 42 +++++++++++++++++++++++++\n 2 files changed, 55 insertions(+)", "diff": "diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc\nindex aa6777e5ed4..791ac2d6ea9 100644\n--- a/gcc/cp/parser.cc\n+++ b/gcc/cp/parser.cc\n@@ -47254,6 +47254,19 @@ cp_parser_omp_allocate (cp_parser *parser, cp_token *pragma_tok)\n \t continue;\n \t }\n \n+\tif (DECL_DECLARED_CONSTEXPR_P (var))\n+\t {\n+\t auto_diagnostic_group d;\n+\t error_at (arg_loc,\n+\t\t \"constexpr variable %qD may not appear as list item in \"\n+\t\t \"an %<allocate%> directive\", var);\n+\t inform (DECL_SOURCE_LOCATION (var),\n+\t\t \"%qD declared here\", var);\n+\t /* Remove the node. */\n+\t *chain = TREE_CHAIN (node);\n+\t continue;\n+\t }\n+\n \t/* Do this before checking if the var was used in another allocate\n \t directive, as the latter diagnostic implies that removing the var\n \t from the previous directive would fix the problem. */\ndiff --git a/gcc/testsuite/g++.dg/gomp/allocate-15.C b/gcc/testsuite/g++.dg/gomp/allocate-15.C\nindex 605e10e477f..ef4bd098fa9 100644\n--- a/gcc/testsuite/g++.dg/gomp/allocate-15.C\n+++ b/gcc/testsuite/g++.dg/gomp/allocate-15.C\n@@ -48,3 +48,45 @@ void instantiate_var_templ()\n dependent_var_templ<int const&&>(); /* { dg-message \"required from here\" } */\n }\n \n+\n+/* Diagnostics for constexpr vars used in an allocate directive. */\n+\n+void cx_var()\n+{\n+ constexpr int cx = 42; /* { dg-note \"'cx' declared here\" } */\n+ #pragma omp allocate(cx) /* { dg-error \"constexpr variable 'cx' may not appear as list item in an 'allocate' directive\" } */\n+}\n+\n+template<typename>\n+void cx_var_templ_not_instantiated()\n+{\n+ constexpr int cx = 42; /* { dg-note \"'cx' declared here\" } */\n+ #pragma omp allocate(cx) /* { dg-error \"constexpr variable 'cx' may not appear as list item in an 'allocate' directive\" } */\n+}\n+\n+template<typename>\n+void cx_var_templ()\n+{\n+ constexpr int cx = 42; /* { dg-note \"'cx' declared here\" } */\n+ #pragma omp allocate(cx) /* { dg-error \"constexpr variable 'cx' may not appear as list item in an 'allocate' directive\" } */\n+}\n+\n+template<typename T>\n+void dependent_cx_var_templ_not_instantiated()\n+{\n+ constexpr T cx = 42; /* { dg-note \"'cx' declared here\" } */\n+ #pragma omp allocate(cx) /* { dg-error \"constexpr variable 'cx' may not appear as list item in an 'allocate' directive\" } */\n+}\n+\n+template<typename T>\n+void dependent_cx_var_templ()\n+{\n+ constexpr T cx = 42; /* { dg-note \"'cx' declared here\" } */\n+ #pragma omp allocate(cx) /* { dg-error \"constexpr variable 'cx' may not appear as list item in an 'allocate' directive\" } */\n+}\n+\n+void instantiate_cx_templ()\n+{\n+ cx_var_templ<void>();\n+ dependent_cx_var_templ<int>();\n+}\n", "prefixes": [ "09/12" ] }