get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.1/patches/2229941/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2229941,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2229941/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260428232657.1953694-1-dmalcolm@redhat.com/",
    "project": {
        "id": 17,
        "url": "http://patchwork.ozlabs.org/api/1.1/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
    },
    "msgid": "<20260428232657.1953694-1-dmalcolm@redhat.com>",
    "date": "2026-04-28T23:26:57",
    "name": "[pushed:,r17-167] analyzer: avoid naked \"new\"",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "a7d3cb4012228d22e2bdc767fafb924b22ca8d9a",
    "submitter": {
        "id": 24465,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/24465/?format=api",
        "name": "David Malcolm",
        "email": "dmalcolm@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260428232657.1953694-1-dmalcolm@redhat.com/mbox/",
    "series": [
        {
            "id": 501950,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/501950/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=501950",
            "date": "2026-04-28T23:26:57",
            "name": "[pushed:,r17-167] analyzer: avoid naked \"new\"",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/501950/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2229941/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2229941/checks/",
    "tags": {},
    "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 (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=Pxb5+CR2;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=temperror (SPF Temporary Error: DNS Timeout) 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 (1024-bit key,\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=Pxb5+CR2",
            "sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com",
            "sourceware.org; spf=pass smtp.mailfrom=redhat.com",
            "server2.sourceware.org;\n arc=none smtp.remote-ip=170.10.133.124"
        ],
        "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 4g4xSG1BQnz1yHv\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 09:27:36 +1000 (AEST)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 52E144BBC0D4\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 23:27:34 +0000 (GMT)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by sourceware.org (Postfix) with ESMTP id D1AC14BB8F69\n for <gcc-patches@gcc.gnu.org>; Tue, 28 Apr 2026 23:27:04 +0000 (GMT)",
            "from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-84-m0ERofsJPgGx_pxqVO6nPA-1; Tue,\n 28 Apr 2026 19:27:02 -0400",
            "from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 761BB1935315\n for <gcc-patches@gcc.gnu.org>; Tue, 28 Apr 2026 23:27:01 +0000 (UTC)",
            "from t14s.localdomain.com (unknown [10.22.65.168])\n by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id EC7831955F26; Tue, 28 Apr 2026 23:27:00 +0000 (UTC)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org 52E144BBC0D4",
            "OpenDKIM Filter v2.11.0 sourceware.org D1AC14BB8F69"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org D1AC14BB8F69",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org D1AC14BB8F69",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777418825; cv=none;\n b=WWzczdV/zeSnxV6VWMlJLXQqm7UE0/QMPtub7p5EB5+aZJHOPdBpRU7KeBfmGF7xqXg92C0b0/wUE/3pA3KNz5t1ghQRsvJKuYSca7XFuah1V1KV0hJE+cRNfqz37+/itUR/epYnITv9Z+FAD/3XV3BBUs0RY+YS/099l+K2Mmw=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777418825; c=relaxed/simple;\n bh=YNR8RBFka4c75C6B2aVMbRKds4yoRqenk9eEAbo1kBE=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=hbGx/0XBx2Ue6T+o5O9c6/ZTQ7MXCwltkuLi9B9Dd3Z+76fLEQaoMIZ7FMejpJp3Wa5Aqnit3BzW/jXsdVK4TRatPS0g7QWSJm9xWU9WxLYk6diAHRV+UdyrEtWYldsK0LCNUeuVAN/WsfWyXM1L8/lAM+gCOp4+oQuxQyxoqXM=",
        "ARC-Authentication-Results": "i=1; server2.sourceware.org",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1777418824;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=znIpoCcRvYyCMTdoyOw9Rz8ZsFVN9vhHErQjKtXVdXU=;\n b=Pxb5+CR21uQ6a9G05yMVYRV3QLqrv8v4PzPvkFcKz7H3HiTBHx+HpIbUZhyNBlnCxF39QP\n 1V/oZluAgxbvfVY1sPpMz2ybK3AgeBSREZLl8hKRXdMvmi5hYzKqO4VIgSH5QVMVjj5oIg\n GZlrM6908Bl2Q8LtEAR5Y+Fr3HunXa0=",
        "X-MC-Unique": "m0ERofsJPgGx_pxqVO6nPA-1",
        "X-Mimecast-MFC-AGG-ID": "m0ERofsJPgGx_pxqVO6nPA_1777418821",
        "From": "David Malcolm <dmalcolm@redhat.com>",
        "To": "gcc-patches@gcc.gnu.org",
        "Cc": "David Malcolm <dmalcolm@redhat.com>",
        "Subject": "[pushed: r17-167] analyzer: avoid naked \"new\"",
        "Date": "Tue, 28 Apr 2026 19:26:57 -0400",
        "Message-ID": "<20260428232657.1953694-1-dmalcolm@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.0 on 10.30.177.12",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-MFC-PROC-ID": "tpHu3J2hefCxxbwySoyb0blSu_Y-tmRAQDXnO5lte_Y_1777418821",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "content-type": "text/plain; charset=\"US-ASCII\"; x-default=true",
        "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": "Modernization; no functional change intended.\n\nSuccessfully bootstrapped & regrtested on powerpc64le-unknown-linux-gnu\n(albeit without ada,cobol,d, and possibly missing some optional test dependencies)\n\nPushed to trunk as r17-167-g2e38eea3266269.\n\ngcc/analyzer/ChangeLog:\n\t* access-diagram.cc\n\t(access_diagram_impl::add_aligned_child_table): Use\n\tstd::make_unique rather than \"new\".\n\t(access_diagram_impl::add_valid_vs_invalid_ruler): Likewise.\n\t* checker-path.h (checker_path::replace_event): Use\n\tstd::unique_ptr.\n\t* diagnostic-manager.cc\n\t(diagnostic_manager::consolidate_conditions): Use std::make_unique\n\trather than \"new\".\n\t* feasible-graph.cc (feasible_graph::make_epath): Likewise.\n\nSigned-off-by: David Malcolm <dmalcolm@redhat.com>\n---\n gcc/analyzer/access-diagram.cc     | 17 ++++++++---------\n gcc/analyzer/checker-path.h        |  4 ++--\n gcc/analyzer/diagnostic-manager.cc | 24 ++++++++++++------------\n gcc/analyzer/feasible-graph.cc     |  2 +-\n 4 files changed, 23 insertions(+), 24 deletions(-)",
    "diff": "diff --git a/gcc/analyzer/access-diagram.cc b/gcc/analyzer/access-diagram.cc\nindex cd725a587d5..9f412b5ec76 100644\n--- a/gcc/analyzer/access-diagram.cc\n+++ b/gcc/analyzer/access-diagram.cc\n@@ -2214,10 +2214,10 @@ private:\n \n   void add_aligned_child_table (table t)\n   {\n-    x_aligned_table_widget *w\n-      = new x_aligned_table_widget (std::move (t), m_theme, *m_col_widths);\n-    m_aligned_table_widgets.push_back (w);\n-    add_child (std::unique_ptr<widget> (w));\n+    auto w = std::make_unique<x_aligned_table_widget> (std::move (t),\n+\t\t\t\t\t\t       m_theme, *m_col_widths);\n+    m_aligned_table_widgets.push_back (w.get ());\n+    add_child (std::move (w));\n   }\n \n   /* Create a table showing headings for use by -fanalyzer-debug-text-art, for\n@@ -2361,8 +2361,7 @@ private:\n   {\n     LOG_SCOPE (m_logger);\n \n-    x_aligned_x_ruler_widget *w\n-      = new x_aligned_x_ruler_widget (*this, m_theme);\n+    auto w = std::make_unique<x_aligned_x_ruler_widget> (*this, m_theme);\n \n     access_range invalid_before_bits;\n     if (m_op.maybe_get_invalid_before_bits (&invalid_before_bits))\n@@ -2410,7 +2409,7 @@ private:\n       valid_bits.log (\"valid_bits\", *m_logger);\n \n     got_valid_bits = true;\n-    maybe_add_gap (w, invalid_before_bits, valid_bits);\n+    maybe_add_gap (w.get (), invalid_before_bits, valid_bits);\n \n     std::unique_ptr<styled_string> label;\n     if (m_op.m_dir == access_direction::read)\n@@ -2441,7 +2440,7 @@ private:\n     if (m_op.maybe_get_invalid_after_bits (&invalid_after_bits))\n       {\n \tif (got_valid_bits)\n-\t  maybe_add_gap (w, valid_bits, invalid_after_bits);\n+\t  maybe_add_gap (w.get (), valid_bits, invalid_after_bits);\n \n \tif (m_logger)\n \t  invalid_before_bits.log (\"invalid_after_bits\", *m_logger);\n@@ -2478,7 +2477,7 @@ private:\n \t  m_logger->log (\"no invalid_after_bits\");\n       }\n \n-    add_child (std::unique_ptr<widget> (w));\n+    add_child (std::move (w));\n   }\n \n   /* Subroutine of calc_req_size.\ndiff --git a/gcc/analyzer/checker-path.h b/gcc/analyzer/checker-path.h\nindex 8dbaf8b26cc..866001c5bee 100644\n--- a/gcc/analyzer/checker-path.h\n+++ b/gcc/analyzer/checker-path.h\n@@ -95,10 +95,10 @@ public:\n     m_events.block_remove (start_idx, len);\n   }\n \n-  void replace_event (unsigned idx, checker_event *new_event)\n+  void replace_event (unsigned idx, std::unique_ptr<checker_event> new_event)\n   {\n     delete m_events[idx];\n-    m_events[idx] = new_event;\n+    m_events[idx] = new_event.release ();\n   }\n \n   void add_region_creation_events (pending_diagnostic *pd,\ndiff --git a/gcc/analyzer/diagnostic-manager.cc b/gcc/analyzer/diagnostic-manager.cc\nindex 8e3aed06420..d8a7f43331c 100644\n--- a/gcc/analyzer/diagnostic-manager.cc\n+++ b/gcc/analyzer/diagnostic-manager.cc\n@@ -2739,19 +2739,19 @@ diagnostic_manager::consolidate_conditions (checker_path *path) const\n \t\t= path->get_checker_event (next_idx - 1);\n \t      log (\"consolidating CFG edge events %i-%i into %i-%i\",\n \t\t   start_idx, next_idx - 1, start_idx, start_idx +1);\n-\t      start_consolidated_cfg_edges_event *new_start_ev\n-\t\t= new start_consolidated_cfg_edges_event\n-\t\t(event_loc_info (old_start_ev->get_location (),\n-\t\t\t\t old_start_ev->get_fndecl (),\n-\t\t\t\t old_start_ev->get_stack_depth ()),\n+\t      auto new_start_ev\n+\t\t= std::make_unique<start_consolidated_cfg_edges_event>\n+\t\t    (event_loc_info (old_start_ev->get_location (),\n+\t\t\t\t     old_start_ev->get_fndecl (),\n+\t\t\t\t     old_start_ev->get_stack_depth ()),\n \t\t edge_sense);\n-\t      checker_event *new_end_ev\n-\t\t= new end_consolidated_cfg_edges_event\n-\t\t(event_loc_info (old_end_ev->get_location (),\n-\t\t\t\t old_end_ev->get_fndecl (),\n-\t\t\t\t old_end_ev->get_stack_depth ()));\n-\t      path->replace_event (start_idx, new_start_ev);\n-\t      path->replace_event (start_idx + 1, new_end_ev);\n+\t      auto new_end_ev\n+\t\t= std::make_unique<end_consolidated_cfg_edges_event>\n+\t\t    (event_loc_info (old_end_ev->get_location (),\n+\t\t\t\t     old_end_ev->get_fndecl (),\n+\t\t\t\t     old_end_ev->get_stack_depth ()));\n+\t      path->replace_event (start_idx, std::move (new_start_ev));\n+\t      path->replace_event (start_idx + 1, std::move (new_end_ev));\n \t      path->delete_events (start_idx + 2, next_idx - (start_idx + 2));\n \t    }\n \t}\ndiff --git a/gcc/analyzer/feasible-graph.cc b/gcc/analyzer/feasible-graph.cc\nindex 02f19223ba3..b40fba0c574 100644\n--- a/gcc/analyzer/feasible-graph.cc\n+++ b/gcc/analyzer/feasible-graph.cc\n@@ -177,7 +177,7 @@ feasible_graph::add_feasibility_problem (feasible_node *src_fnode,\n std::unique_ptr<exploded_path>\n feasible_graph::make_epath (feasible_node *fnode) const\n {\n-  std::unique_ptr<exploded_path> epath (new exploded_path ());\n+  auto epath = std::make_unique<exploded_path> ();\n \n   /* FG is actually a tree.  Built the path backwards, by walking\n      backwards from FNODE until we reach the origin.  */\n",
    "prefixes": [
        "pushed:",
        "r17-167"
    ]
}