Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2216545/?format=api
{ "id": 2216545, "url": "http://patchwork.ozlabs.org/api/patches/2216545/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260326173459.76175-1-iain@sandoe.co.uk/", "project": { "id": 17, "url": "http://patchwork.ozlabs.org/api/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": "<20260326173459.76175-1-iain@sandoe.co.uk>", "list_archive_url": null, "date": "2026-03-26T17:34:47", "name": "c++, contracts: Omit unnecessary const-wrappers.", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "b9e3d2fb72275b5f09a8c507e2395232a8ddafc6", "submitter": { "id": 80672, "url": "http://patchwork.ozlabs.org/api/people/80672/?format=api", "name": "Iain Sandoe", "email": "iains.gcc@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260326173459.76175-1-iain@sandoe.co.uk/mbox/", "series": [ { "id": 497632, "url": "http://patchwork.ozlabs.org/api/series/497632/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=497632", "date": "2026-03-26T17:34:47", "name": "c++, contracts: Omit unnecessary const-wrappers.", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/497632/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2216545/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2216545/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=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=E3+hQXt3;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.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=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=E3+hQXt3", "sourceware.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "sourceware.org; spf=pass smtp.mailfrom=gmail.com", "server2.sourceware.org;\n arc=none smtp.remote-ip=209.85.221.41" ], "Received": [ "from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 4fhWBr1Z5rz1y1x\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 27 Mar 2026 04:35:32 +1100 (AEDT)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id EB3904BA23FB\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 17:35:29 +0000 (GMT)", "from mail-wr1-f41.google.com (mail-wr1-f41.google.com\n [209.85.221.41])\n by sourceware.org (Postfix) with ESMTPS id 54A064BA2E0E\n for <gcc-patches@gcc.gnu.org>; Thu, 26 Mar 2026 17:35:01 +0000 (GMT)", "by mail-wr1-f41.google.com with SMTP id\n ffacd0b85a97d-439bc14dcf4so1785753f8f.1\n for <gcc-patches@gcc.gnu.org>; Thu, 26 Mar 2026 10:35:01 -0700 (PDT)", "from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com.\n [81.138.1.83]) by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-48722cb5845sm41624945e9.15.2026.03.26.10.34.59\n (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);\n Thu, 26 Mar 2026 10:34:59 -0700 (PDT)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org EB3904BA23FB", "OpenDKIM Filter v2.11.0 sourceware.org 54A064BA2E0E" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 54A064BA2E0E", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 54A064BA2E0E", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1774546501; cv=none;\n b=guO0jJlN35azPjemh9ChOTx/16E/cuKEA3bVYU1glVYfZzS180UnqrnG/VjepkQV/V0c7GaUXePQcrkuxqaSB7JgDgfKGiYuVr69NoYu/7jsioxmW+LduhOiEUsJ1xokrCEZ2Hzc+ZVLk0IfY9Yx04WAM5voY6jlq6+W1JnJVDg=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1774546501; c=relaxed/simple;\n bh=dYvuClyL9UevI21kzdANo+Iba1LfFcNtNDHynkFmi40=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=xhNW32XCmSCrmYkMwWdiZepgHdGCslUS1lzMGr/kj6oIRD51XB3ptY7W8ns15FzWE/oS60DifKn4tvKXnazeLXyNHYg1RnmcvWRoYjzhna8W+iDBtOp2FX3MMFHYN3k4PlVb2HTT5CZCItoeVuZgNHH4+sqqvd6B76x2LD00pf4=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1774546500; x=1775151300; darn=gcc.gnu.org;\n h=content-transfer-encoding:mime-version:reply-to:message-id:date\n :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=791O3QSUJqQd+gUSoduO6hCQPvJxXMubM3AgoAiSWYk=;\n b=E3+hQXt3PEml7Zkkzv/X6WdmM3fvw3kAx5GyusENq1OTHQQMznchT/HA+b/XtcnI2t\n UqLOwxj9ZJ9HhuJAzSmsoK3aty6jZHpsR9WwLWJSZdbAoelNzVjBwNTY8/zFSG4/Bwlp\n 9HoZypm2x4MdoADOrYeO5fUILm4VHQmplIftL2kVEbkombqmC67gwOqiUi3D24gLIQlx\n r4OjaatDIGCxt/+gi0RYwGuekw45nQq4Jls9WIXuiXzRKSLxhuuvoUi25tsikz+LPbO8\n ldj6xk34oi7Hv5fHo47ubP2KAB/YZcLWVZL9hsdiAt1MQhT6YgntFuZdcboljavMeAbJ\n sy7Q==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774546500; x=1775151300;\n h=content-transfer-encoding:mime-version:reply-to:message-id:date\n :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject\n :date:message-id:reply-to;\n bh=791O3QSUJqQd+gUSoduO6hCQPvJxXMubM3AgoAiSWYk=;\n b=N4+k10hymVGXcySSMgIrtaQkpZP1b3HTii9L4de3+VfZWxW5230XSrnzC3PUHIzobt\n tUjZdG2nW9ZKZ3kUmLlyx/Zm0+ZePATl3Zg7fTzM4xifAC33maYHkJv4bVL9z4FkeFVq\n GbnueLf7Ei0J/lpH+B6ueNoqNVkAiZ0jeVV/x7PDXZRYkAG84+3d0bDGSiof9DsjKdtr\n /3/GIrtqOmkqgn9bWxh/apT2mNWsLIl5hhJMg+4CUhYzvFJFynWeWgMOv6Y54ZzwY253\n WwahNG9T85T+PNxpFIM3H7jkYp3GtSTHWDjA2qPQDaBHCy9jj2+hGOaKsEuO+XVRWqBd\n +WJw==", "X-Gm-Message-State": "AOJu0YxUOM7VdPU+DDfhQcV+X6TkzO26VJFRi9uXpe5lpZDCfYkpmDmF\n T4D8bNaRPNx5AU6ZlUsl/3KrkTRc5DVvN/IvBnpYbfUo2i8xJjQKfeMdeasFlA==", "X-Gm-Gg": "ATEYQzw4E4DedZ7r4T3zafKPIZ9Q9olngNf9yqgc47DtO1F5fsYApVRwwAgBtJuOaqV\n 463fZSORAYABYlv8qKKylTszh1N12eeG3Dm3lPEN6MGQqxTi17qrmytk4zf8ojMTMJgmFPFAeO/\n NHa/HwV8Be82+//8Y8Yb8VeACv8oKatnrPGYyW+r1jz/qVUwS3KgfWtMgWRqDwFxnH8kmrKLTt1\n ysDN6LwI339lqZWncL2ovz8T/YfbjwcxnBOeLdKJPOS5yTTJSmmAK+s77Lf0s+RILg6AjwoATiH\n FhSNcccUh3OkzNg8EuwW/rcj4SZDXpURhfoqw+/oNsfL8hYN2ufxynkopq2hQGS+sHOhpfdRy0X\n wjCzss4DCf5ZdcQBMRJ5NHxPobe44DKegl89D5+EdHz4bOhdbikVl5cOlVEwEW4IPNE508aKkpy\n KjTG2C04mO1eMg6rjwqOSlsZnI0SlkKa7hIZtsqE+BQ+j/VDcSH/E4DTw1bsyzuAcfGvKpqY49M\n c4rzJQWeuM=", "X-Received": "by 2002:a05:600c:358f:b0:486:faa8:9e4 with SMTP id\n 5b1f17b1804b1-48722be3f84mr42076295e9.12.1774546500070;\n Thu, 26 Mar 2026 10:35:00 -0700 (PDT)", "From": "Iain Sandoe <iains.gcc@gmail.com>", "X-Google-Original-From": "Iain Sandoe <iain@sandoe.co.uk>", "To": "gcc-patches@gcc.gnu.org", "Cc": "jason@redhat.com", "Subject": "[PATCH] c++, contracts: Omit unnecessary const-wrappers.", "Date": "Thu, 26 Mar 2026 17:34:47 +0000", "Message-ID": "<20260326173459.76175-1-iain@sandoe.co.uk>", "X-Mailer": "git-send-email 2.50.1", "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>", "Reply-To": "iain@sandoe.co.uk", "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org" }, "content": "This does not fix any current BZ (or anything latent AFAIK) it is\njust a cleanup that is in my stack. Tested on x86_64-darwin,\nx86_64, powerpc64le-linux, OK for trunk/when ?\nthanks\nIain\n\n--- 8< ---\n\nWe need to view class pointers as const, which we do by wrapping\nthem in a view convert expression. However, we do not need to do\nthis if the original is already const-qualified.\n\ngcc/cp/ChangeLog:\n\n\t* parser.cc (cp_parser_late_contract_condition): Check\n\tfor const-qualified class pointer before wrapping it.\n\t(cp_parser_contract_assert): Likewise.\n\t(cp_parser_function_contract_specifier): Likewise.\n\nSigned-off-by: Iain Sandoe <iain@sandoe.co.uk>\n---\n gcc/cp/parser.cc | 12 ++++++------\n 1 file changed, 6 insertions(+), 6 deletions(-)", "diff": "diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc\nindex e5157cd7386..a159e9b8520 100644\n--- a/gcc/cp/parser.cc\n+++ b/gcc/cp/parser.cc\n@@ -33574,8 +33574,8 @@ cp_parser_late_contract_condition (cp_parser *parser, tree fn, tree contract)\n /* If we have a current class object, we need to consider\n it const when processing the contract condition. */\n tree current_class_ref_copy = current_class_ref;\n- if (flag_contracts && current_class_ref_copy)\n- current_class_ref = view_as_const (current_class_ref_copy);\n+ if (current_class_ref && !CP_TYPE_CONST_P (TREE_TYPE (current_class_ref)))\n+ current_class_ref = view_as_const (current_class_ref);\n \n /* Parse the condition, ensuring that parameters or the return variable\n aren't flagged for use outside the body of a function. */\n@@ -33682,8 +33682,8 @@ cp_parser_contract_assert (cp_parser *parser, cp_token *token)\n /* If we have a current class object, see if we need to consider\n it const when processing the contract condition. */\n tree current_class_ref_copy = current_class_ref;\n- if (current_class_ref_copy)\n- current_class_ref = view_as_const (current_class_ref_copy);\n+ if (current_class_ref && !CP_TYPE_CONST_P (TREE_TYPE (current_class_ref)))\n+ current_class_ref = view_as_const (current_class_ref);\n \n /* Parse the condition. */\n begin_scope (sk_contract, current_function_decl);\n@@ -33848,8 +33848,8 @@ cp_parser_function_contract_specifier (cp_parser *parser)\n /* If we have a current class object, see if we need to consider\n it const when processing the contract condition. */\n tree current_class_ref_copy = current_class_ref;\n- if (current_class_ref_copy)\n- current_class_ref = view_as_const (current_class_ref_copy);\n+ if (current_class_ref && !CP_TYPE_CONST_P (TREE_TYPE (current_class_ref)))\n+\tcurrent_class_ref = view_as_const (current_class_ref);\n \n /* Parse the condition, ensuring that parameters or the return variable\n aren't flagged for use outside the body of a function. */\n", "prefixes": [] }