get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2194242,
    "url": "http://patchwork.ozlabs.org/api/patches/2194242/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260207164431.167554-1-ppalka@redhat.com/",
    "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": "<20260207164431.167554-1-ppalka@redhat.com>",
    "list_archive_url": null,
    "date": "2026-02-07T16:44:31",
    "name": "c++: non-trivial by-value deducing this lambda [PR121500]",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "9687aeb49404d8b0ed2ac5a4477f301a718ab560",
    "submitter": {
        "id": 78319,
        "url": "http://patchwork.ozlabs.org/api/people/78319/?format=api",
        "name": "Patrick Palka",
        "email": "ppalka@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260207164431.167554-1-ppalka@redhat.com/mbox/",
    "series": [
        {
            "id": 491388,
            "url": "http://patchwork.ozlabs.org/api/series/491388/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=491388",
            "date": "2026-02-07T16:44:31",
            "name": "c++: non-trivial by-value deducing this lambda [PR121500]",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/491388/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2194242/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2194242/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 (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=eWu3E856;\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 (1024-bit key,\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=eWu3E856",
            "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.129.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 4f7cJW6bMvz1xtV\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 08 Feb 2026 03:45:14 +1100 (AEDT)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 4616748FEF41\n\tfor <incoming@patchwork.ozlabs.org>; Sat,  7 Feb 2026 16:45:07 +0000 (GMT)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by sourceware.org (Postfix) with ESMTP id 9374B4CF2FFC\n for <gcc-patches@gcc.gnu.org>; Sat,  7 Feb 2026 16:44:37 +0000 (GMT)",
            "from mail-qt1-f199.google.com (mail-qt1-f199.google.com\n [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-91-pXyNa21-OQauzQxMYAASLg-1; Sat, 07 Feb 2026 11:44:35 -0500",
            "by mail-qt1-f199.google.com with SMTP id\n d75a77b69052e-5029a8193c0so12203301cf.0\n for <gcc-patches@gcc.gnu.org>; Sat, 07 Feb 2026 08:44:35 -0800 (PST)",
            "from idea ([2600:4040:aa68:6000:9e8e:99ff:fed1:71f])\n by smtp.gmail.com with ESMTPSA id\n d75a77b69052e-50640c60b3csm34150931cf.8.2026.02.07.08.44.32\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sat, 07 Feb 2026 08:44:32 -0800 (PST)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org 4616748FEF41",
            "OpenDKIM Filter v2.11.0 sourceware.org 9374B4CF2FFC"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 9374B4CF2FFC",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 9374B4CF2FFC",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1770482677; cv=none;\n b=V/kiqafIammNvGVqq11iTYYPzT6EzX2QOf29ATKEaaVzHv9ska/dffrgwGJBZtjT8rGzzmQVbfFo0bAJruqf1QfOVMRt0XWlBAVgmHol8Fgfc7UgIUAbzj+GsxhLbcj6qfWVXualHaw+c4vYPgSE4aTL0JW2CXgDHuWVs8J423U=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1770482677; c=relaxed/simple;\n bh=Z2k0HmL7j33cJSw3ezdn9c4XIfT1TLxYJK4jXmzba4o=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=hPXvY8Wf2ndDO98CRd/xdKzXjo7seNryu4IYlKjRwH6l+QsQThfmrPft/ZLAaYFPIhqBAoqhPodDpsAJ+M605bHHZK8nKhbXbuk3BBXJTwv4EF5ZDPD4tcvR5u8fCKCBytGUaTKt9JaX7Fe4nN/ri9yaKoTG6FbSxJblcN1PWHk=",
        "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=1770482677;\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=Az5I6Cn5UsTCZyaF5UvPaicWcYdZxwopfnN9k9mj2aA=;\n b=eWu3E856gYPy9Kp302Pysh0HP5zwc0QSOGAjX6DxlIBCJlh8JB6bZKEjiRodIaO+j0jbqP\n CfmbCN2pUh9I69zT4EazRFQ1RYNTAfSZAEYeXFFdTeBpFz33yL8CvJXrb409bPaxQ9/m8O\n +QLliEiEbQ+ZkSgFw+2/8/T6AzbBh2g=",
        "X-MC-Unique": "pXyNa21-OQauzQxMYAASLg-1",
        "X-Mimecast-MFC-AGG-ID": "pXyNa21-OQauzQxMYAASLg_1770482675",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1770482674; x=1771087474;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=Az5I6Cn5UsTCZyaF5UvPaicWcYdZxwopfnN9k9mj2aA=;\n b=hRLYnYquLOXbxyV3Lf+eTRk97tDxG0OVYXn+iUXxggRnO6jUzVqWBHiwTIXyxWKghS\n v8Bo0bOxTg3tFWeWmqq7XbrxfZwqc4bMwAAy2q2AwQOwsQMuDpLjmvs92vy2JScRT4zv\n oTPDQMT/gkeaguXSk3uPd+TCWytpyRz3ra5ep43hdqAOhnDIwPllQL2Pvtx8lV5eoMW6\n yK3pfJl0S0GFZwCU6ubt0M7Dubof5nzOI8uSABTykbGl49GgjeHz/5Rx3z3C0JanTmSD\n reqMIENknay2QpFY4hfYoxS7OMQ03KzHcu02AQgmDNaeup3mE3gU+Sj9jWGQDNP+kDhC\n utYg==",
        "X-Gm-Message-State": "AOJu0Yw70IucZnvalRaUg7hx0fnbtqb4F9ACK5wVSSzwiJ/IbhoTFISG\n TosTxipdN8ZpF6uyW/2KJwylodpYmuxaf8+kzhgB/WZ/16LJGRES6pMKGZqVp+LOca1khMgVtDN\n 8bBx2Qb+o4ByxUDcJa3kycpAKrdJ+EGnowbJXHb2UAbejoKvHCsksqZlzqM2U+duevFJrdHjZ0O\n iQj8ug2a+D0nxehSx/YDgHXsDUBBoXSgKKLUGU3sHs",
        "X-Gm-Gg": "AZuq6aJukRAIcP7jE6HWgz7zKdsqcMdVR19yqpG7b21+ssOSNOuNWdhxZ+0VVI/qD6o\n C4I6v3ZZPvZFcLVLbQo63h13BjArD0I2fL4dz0LdUwXwiEbTsm8FQEo5lyxlEkolPiPyLoqOdGu\n Ejygxn8bXARwOBYAlrKE4ilqPxMSawJCYYs65n9IFFdgldxEhLaPkrgu/mhlcgxz3FaliH2yT3K\n gQ9e00U91fQl52R82/KyFR50o1ZjI6MpW2Ld6wCS/n5oTckzGlIV8Y8c9J4qouoBPaczVWwi5Cp\n DE3OTBQAIq7ge8rGTI6+Z5kP3uchD9d3gDM0sc7Mok9b+TmEB6I0Glav96WJi/+ESxRFeI9mGs8\n =",
        "X-Received": [
            "by 2002:ac8:590b:0:b0:502:9a94:2f87 with SMTP id\n d75a77b69052e-506399db934mr67955741cf.7.1770482674433;\n Sat, 07 Feb 2026 08:44:34 -0800 (PST)",
            "by 2002:ac8:590b:0:b0:502:9a94:2f87 with SMTP id\n d75a77b69052e-506399db934mr67955571cf.7.1770482673996;\n Sat, 07 Feb 2026 08:44:33 -0800 (PST)"
        ],
        "From": "Patrick Palka <ppalka@redhat.com>",
        "To": "gcc-patches@gcc.gnu.org",
        "Cc": "jason@redhat.com,\n\tPatrick Palka <ppalka@redhat.com>",
        "Subject": "[PATCH] c++: non-trivial by-value deducing this lambda [PR121500]",
        "Date": "Sat,  7 Feb 2026 11:44:31 -0500",
        "Message-ID": "<20260207164431.167554-1-ppalka@redhat.com>",
        "X-Mailer": "git-send-email 2.53.0.40.g3e0db84c88",
        "MIME-Version": "1.0",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-MFC-PROC-ID": "33SPpjxPUFUx7Bb-MxUMql1jTTmXfqn_Dpn-ltLtehg_1770482675",
        "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": "Bootstrapped and regtested on x86_64-pc-linux-gnu, does this\nlook OK for stage1 perhaps?\n\nFWIW I couldn't get a structured binding (which are also implemented via\nDECL_VALUE_EXPR) testcase to misbehave, because for e.g.\n\n  template<class T>\n  void f(T t) {\n    auto [x,y] = t;\n    ...\n  }\n\nwe lower it to:\n\n  struct A D.2730;\n  int x [value-expr: D.2730.n];\n  int y [value-expr: D.2730.m];\n  ...\n  A::A (&D.2730, t);\n\ni.e. the value-exprs are in terms of a local copy of the invisiref parm\nso they don't need adjustment.  Whereas for this PR the value-exprs are\ndirectly in terms of the invisiref parm.\n\nFor auto& [x,y] = t; we do:\n\n  struct A & D.2720;\n  int x [value-expr: D.2720->n];\n  int y [value-expr: D.2720->m];\n  D.2720 = t;\n\n-- >8 --\n\nHere the lambda has a by-value capture of non-trivial type, which\nin turn makes the closure type non-trivial.  This means its by-value\n'this' parameter, which gets deduced to the closure type, becomes an\ninvisiref parameter, and so when lowering the operator() body we need to\nadjust uses of 'this' by adding implicit dereferences.\n\nBut the GIMPLE dump for operator() shows that we miss some adjustments:\n\n  bool main()::<lambda(this auto:1)>::operator()<main()::<lambda(this auto:1)> > (struct ._anon_0 & self)\n  {\n    bool D.3091;\n    struct ._anon_0 & self.1;\n    struct A data [value-expr: self.__data]; // should be self->__data\n\n    self.1 = self;\n    _1 = self.1.__data.n; // same\n    D.3091 = _1 == 42;\n    return D.3091;\n  }\n\nApparently this is because cp_genericize_r, which is responsible for the\ninvisiref use adjustments, never walks DECL_VALUE_EXPR.  This patch makes\nus walk it.\n\n\tPR c++/121500\n\ngcc/cp/ChangeLog:\n\n\t* cp-gimplify.cc (cp_genericize_r): Walk DECL_VALUE_EXPR.\n\ngcc/testsuite/ChangeLog:\n\n\t* g++.dg/cpp23/explicit-obj-lambda20.C: New test.\n---\n gcc/cp/cp-gimplify.cc                            | 10 ++++++++++\n .../g++.dg/cpp23/explicit-obj-lambda20.C         | 16 ++++++++++++++++\n 2 files changed, 26 insertions(+)\n create mode 100644 gcc/testsuite/g++.dg/cpp23/explicit-obj-lambda20.C",
    "diff": "diff --git a/gcc/cp/cp-gimplify.cc b/gcc/cp/cp-gimplify.cc\nindex 9d96ce99ea92..11fa6cff40ba 100644\n--- a/gcc/cp/cp-gimplify.cc\n+++ b/gcc/cp/cp-gimplify.cc\n@@ -1914,6 +1914,16 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data)\n       return NULL_TREE;\n     }\n \n+  if (TREE_CODE (stmt) == VAR_DECL\n+      || TREE_CODE (stmt) == PARM_DECL\n+      || TREE_CODE (stmt) == RESULT_DECL)\n+    if (tree ve = DECL_VALUE_EXPR (stmt))\n+      {\n+\tcp_walk_tree (&ve, cp_genericize_r, data, NULL);\n+\tSET_DECL_VALUE_EXPR (stmt, ve);\n+\tp_set->add (ve);\n+      }\n+\n   switch (TREE_CODE (stmt))\n     {\n     case ADDR_EXPR:\ndiff --git a/gcc/testsuite/g++.dg/cpp23/explicit-obj-lambda20.C b/gcc/testsuite/g++.dg/cpp23/explicit-obj-lambda20.C\nnew file mode 100644\nindex 000000000000..f55b4b78b96e\n--- /dev/null\n+++ b/gcc/testsuite/g++.dg/cpp23/explicit-obj-lambda20.C\n@@ -0,0 +1,16 @@\n+// PR c++/121500\n+// { dg-do run { target c++23 } }\n+\n+struct A {\n+  A() = default;\n+  A(const A& other) : n(other.n) { }\n+  int n = 42;\n+};\n+\n+int main() {\n+   auto l = [data = A()](this auto self) {\n+     return data.n == 42;\n+   };\n+   if (!l())\n+     __builtin_abort();\n+}\n",
    "prefixes": []
}