Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2222981/?format=api
{ "id": 2222981, "url": "http://patchwork.ozlabs.org/api/patches/2222981/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/ad3jptMuTbkr2kgd@tucnak/", "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": "<ad3jptMuTbkr2kgd@tucnak>", "list_archive_url": null, "date": "2026-04-14T06:50:14", "name": "c++: Check base accessibility in cp_decomp_size [PR124862]", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "2df4950ee91e0a87ef8ce957b7146a4c6e296cd8", "submitter": { "id": 671, "url": "http://patchwork.ozlabs.org/api/people/671/?format=api", "name": "Jakub Jelinek", "email": "jakub@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/ad3jptMuTbkr2kgd@tucnak/mbox/", "series": [ { "id": 499785, "url": "http://patchwork.ozlabs.org/api/series/499785/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=499785", "date": "2026-04-14T06:50:14", "name": "c++: Check base accessibility in cp_decomp_size [PR124862]", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/499785/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2222981/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2222981/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=YY9HmsB9;\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=YY9HmsB9", "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 4fvw0834Lvz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 16:50:48 +1000 (AEST)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 6CB6C4BA2E3D\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 06:50:46 +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 16E6B4BA2E09\n for <gcc-patches@gcc.gnu.org>; Tue, 14 Apr 2026 06:50:20 +0000 (GMT)", "from mx-prod-mc-01.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-490-WJ_Lt2zsN4qWPTETCFHBsg-1; Tue,\n 14 Apr 2026 02:50:18 -0400", "from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93])\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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 9177819560AE\n for <gcc-patches@gcc.gnu.org>; Tue, 14 Apr 2026 06:50:17 +0000 (UTC)", "from tucnak.zalov.cz (unknown [10.44.33.129])\n by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with\n ESMTPS\n id F08E1180057F; Tue, 14 Apr 2026 06:50:16 +0000 (UTC)", "from tucnak.zalov.cz (localhost [127.0.0.1])\n by tucnak.zalov.cz (8.18.1/8.18.1) with ESMTPS id 63E6oE1b2951618\n (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);\n Tue, 14 Apr 2026 08:50:14 +0200", "(from jakub@localhost)\n by tucnak.zalov.cz (8.18.1/8.18.1/Submit) id 63E6oENU2951617;\n Tue, 14 Apr 2026 08:50:14 +0200" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 6CB6C4BA2E3D", "OpenDKIM Filter v2.11.0 sourceware.org 16E6B4BA2E09" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 16E6B4BA2E09", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 16E6B4BA2E09", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776149420; cv=none;\n b=IOKYmqMGVHCgqgef1FjPUSSKy5LB9HvGD4+dVwCTBCEQXcrImtKFZo81UdGQI8bm90jRdttZeerXAVu9BMnJg6ad3V5JuP85H5jRmbZcxqTUCWgdM0RfCsZvXDQnEhlEGzw3uoYyoZhoUx1HWZHa7Xcb1jcuzPOj7rO1GmVhU1M=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776149420; c=relaxed/simple;\n bh=/LEJrYQgBl749VxlGWnMNYuGcHOo8alSo/2/36oQz4E=;\n h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version;\n b=UXLxfbbZ+TenHTfM7bmx7QEUbo8LFxnCG/73gPINdeEvfZ9FwpsY+iZoWHoKOsc8eG+7DUKeqlgex5zjl5cBGfSL9Aihcd+u595crQw8mDhuA9cv8gtiffnJ4rwqDBzgEG5z/VC2IfmyoJD7Od/VtjZPlNwqQW5YCkyzRNQs52s=", "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=1776149419;\n h=from:from:reply-to:reply-to:subject:subject:date:date:\n message-id:message-id:to:to:cc:cc:mime-version:mime-version:\n content-type:content-type; bh=32I+69/eMSmJfLaq5G+DzT53zBh5EKdwLxhaQ5ptgPo=;\n b=YY9HmsB9RjiLVqCyf2cWJHu9A3RNPN1R5msQ1/Hcu9L6v7o9c4ZAmUU/A+9VUTk4hi2aPr\n 9ae0Iio+VepSUiImZddPphvxbFkFDXvx+U8L9U4srEPeM78ZnzSZ5q6PMKlSzbvD9OjH1O\n gJIGgexultP6uwaOOnZcJNf29n68YWA=", "X-MC-Unique": "WJ_Lt2zsN4qWPTETCFHBsg-1", "X-Mimecast-MFC-AGG-ID": "WJ_Lt2zsN4qWPTETCFHBsg_1776149417", "Date": "Tue, 14 Apr 2026 08:50:14 +0200", "From": "Jakub Jelinek <jakub@redhat.com>", "To": "Jason Merrill <jason@redhat.com>", "Cc": "gcc-patches@gcc.gnu.org", "Subject": "[PATCH] c++: Check base accessibility in cp_decomp_size [PR124862]", "Message-ID": "<ad3jptMuTbkr2kgd@tucnak>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.93", "X-Mimecast-Spam-Score": "0", "X-Mimecast-MFC-PROC-ID": "kj8QoIEPtzW6vTsVzyUkdOmo46KGKVwYRa9fdL7M7Xc_1776149417", "X-Mimecast-Originator": "redhat.com", "Content-Type": "text/plain; charset=us-ascii", "Content-Disposition": "inline", "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": "Jakub Jelinek <jakub@redhat.com>", "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org" }, "content": "Hi!\n\nclang in __builtin_structured_binding_size checks whether base which\ncontains the destructible members is accessible.\nIn cp_finish_decomp we call:\n if (type != btype)\n {\n t = convert_to_base (t, btype, /*check_access*/true,\n /*nonnull*/false, tf_warning_or_error);\n type = btype;\n }\nwhich calls lookup_base which diagnoses that. The following patch\njust calls lookup_base in that case.\n\nBootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?\n\n2026-04-14 Jakub Jelinek <jakub@redhat.com>\n\n\tPR c++/124862\n\t* decl.cc (cp_decomp_size): If btype is different from type,\n\tcheck if it is accessible.\n\n\t* g++.dg/ext/builtin-structured-binding-size5.C: New test.\n\t* g++.dg/ext/builtin-structured-binding-size6.C: New test.\n\n\n\tJakub", "diff": "--- gcc/cp/decl.cc.jj\t2026-04-08 07:46:31.098631631 +0200\n+++ gcc/cp/decl.cc\t2026-04-13 10:47:38.170670623 +0200\n@@ -10671,6 +10671,12 @@ cp_decomp_size (location_t loc, tree typ\n \treturn -1;\n else if (btype == NULL_TREE)\n \treturn 0;\n+ if (btype != type)\n+\t{\n+\t tree binfo = lookup_base (type, btype, ba_check, NULL, complain);\n+\t if (binfo == NULL_TREE || binfo == error_mark_node)\n+\t return -1;\n+\t}\n for (tree field = TYPE_FIELDS (btype); field; field = TREE_CHAIN (field))\n \tif (TREE_CODE (field) != FIELD_DECL\n \t || DECL_ARTIFICIAL (field)\n--- gcc/testsuite/g++.dg/ext/builtin-structured-binding-size5.C.jj\t2026-04-13 10:53:55.136222340 +0200\n+++ gcc/testsuite/g++.dg/ext/builtin-structured-binding-size5.C\t2026-04-13 11:00:39.924299802 +0200\n@@ -0,0 +1,13 @@\n+// PR c++/124862\n+// { dg-do compile { target c++20 } }\n+\n+struct S\n+{\n+ int a = 0, b = 0, c = 0;\n+};\n+\n+struct T : private S\n+{};\n+\n+static_assert (__builtin_structured_binding_size (S) == 3);\n+auto a = __builtin_structured_binding_size (T);\t\t// { dg-error \"'S' is an inaccessible base of 'T'\" }\n--- gcc/testsuite/g++.dg/ext/builtin-structured-binding-size6.C.jj\t2026-04-13 10:54:38.765476033 +0200\n+++ gcc/testsuite/g++.dg/ext/builtin-structured-binding-size6.C\t2026-04-13 10:55:37.163477088 +0200\n@@ -0,0 +1,16 @@\n+// PR c++/124862\n+// { dg-do compile { target c++20 } }\n+\n+struct S\n+{\n+ int a = 0, b = 0, c = 0;\n+};\n+\n+struct T : private S\n+{};\n+\n+template <typename T>\n+concept is_destructurable = requires { { __builtin_structured_binding_size (T) }; };\n+\n+static_assert (is_destructurable <S>);\n+static_assert (!is_destructurable <T>);\n", "prefixes": [] }