Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2223250/?format=api
{ "id": 2223250, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2223250/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260414195412.221509-1-ppalka@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": "<20260414195412.221509-1-ppalka@redhat.com>", "date": "2026-04-14T19:54:12", "name": "c++: identity of A<^^alias> [PR124544]", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "caf3c2d8acae2893db5d15fd30ba2a9aa5df0b12", "submitter": { "id": 78319, "url": "http://patchwork.ozlabs.org/api/1.1/people/78319/?format=api", "name": "Patrick Palka", "email": "ppalka@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260414195412.221509-1-ppalka@redhat.com/mbox/", "series": [ { "id": 499891, "url": "http://patchwork.ozlabs.org/api/1.1/series/499891/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=499891", "date": "2026-04-14T19:54:12", "name": "c++: identity of A<^^alias> [PR124544]", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/499891/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2223250/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2223250/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=NbbzO5Au;\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 (1024-bit key,\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=NbbzO5Au", "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 [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 4fwFQC5x1cz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 05:56:03 +1000 (AEST)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 0F11E4BA2E15\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 19:56:02 +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 93B5B4BA2E08\n for <gcc-patches@gcc.gnu.org>; Tue, 14 Apr 2026 19:54:18 +0000 (GMT)", "from mail-qt1-f200.google.com (mail-qt1-f200.google.com\n [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-78-0l8xpiGzMbybQvulrTDKwg-1; Tue, 14 Apr 2026 15:54:17 -0400", "by mail-qt1-f200.google.com with SMTP id\n d75a77b69052e-50d7128e038so14747001cf.2\n for <gcc-patches@gcc.gnu.org>; Tue, 14 Apr 2026 12:54:16 -0700 (PDT)", "from idea ([2600:4040:aa66:bf00:9e8e:99ff:fed1:71f])\n by smtp.gmail.com with ESMTPSA id\n 6a1803df08f44-8aca1bee6ecsm101210806d6.6.2026.04.14.12.54.13\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 14 Apr 2026 12:54:13 -0700 (PDT)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 0F11E4BA2E15", "OpenDKIM Filter v2.11.0 sourceware.org 93B5B4BA2E08" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 93B5B4BA2E08", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 93B5B4BA2E08", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776196458; cv=none;\n b=UxEzMWfImBZ77kgZI0idr7Jf+Luyniz/DQEcFY3djOSM9dNeSrS67yedIFirXMluzG2KzNgEk9oJS/1Mqv2JepV2Cxu8x3ap8u48Pn1o3QSUdaNoDoxpDgXyGv9bn01AvMB0xGrRlXYNO5PDUD291Mbd35IFsdtwvjCxIjK0+00=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776196458; c=relaxed/simple;\n bh=K8jIf0ytGQoVo2TuClm8HTmcbNKkgrxg9YFuxKUvg3g=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=gM+VgmA9ehu+JJWiOWMGJuDSLHxd1JnQAGnF/XfEQHPRMgshn+pVfOsb1vqwRcBqaSNnRF6p+3WnTeNHmoIU5TT1svZlz/AcAkwZ1v01Lza9EFUtrbJ6XF8lbyp9PBKdzqfgyHttEm8hz1iPPfYGM6BNWkm2Pm5XAZY5ULarTuw=", "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=1776196458;\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=kQisnxOorHOSiOIzNc3VuO3OCCmSt7ZGIpGHp6pkWuY=;\n b=NbbzO5AuUy/dvvd9+xldZDqeqSml2V8c2MTQBfNGfPjFtSLNm52fZfokqeWs5ju+I6Ytly\n tSa4YanpM5spyMbXhZDpPWCgM8fSMHN3iy+5acJwLYAu5ngr0E/laJwZ0y4LoR9Q/xGpa2\n GG1FldD7SLAlKT/Rj2H6Qypyr2D5Lsg=", "X-MC-Unique": "0l8xpiGzMbybQvulrTDKwg-1", "X-Mimecast-MFC-AGG-ID": "0l8xpiGzMbybQvulrTDKwg_1776196456", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776196455; x=1776801255;\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=kQisnxOorHOSiOIzNc3VuO3OCCmSt7ZGIpGHp6pkWuY=;\n b=a809oG8U137lCJ9YqX8bprfGuNck1siQa0DVaAO81pn+7Rp74LFXo8PM2rJVbfaI8l\n zewfix9r+a2oPmj9gT0BHrqc4wWK+BPRgK20pyFns++Evd/ufJ1E+EoUG+0mx9443xA3\n DeEoBn2QA5Wyi2JwcpJgHcgSF7d3vJJK0sUgH0G07zN4uTv2w71ub7URabDATYlOpP9f\n U7tEAKOUrbQqvSby8ODeLO/TBgHMlRfDQlmgSCsWt9EYnCh4kYLzQIHdZSczvGaSQpk3\n eReCsZxlMR3utWDCqogkhwAP5FH+lmd4MqbasGVEiowq9PVvDD6kD9fqfu+kChk4YB+2\n wAcQ==", "X-Gm-Message-State": "AOJu0Yz2/PgqSFuCSnKPxh0U+yWQofvORtPZ4TqX94XmMMzkczCsGICO\n sdQo54hGbTadZseP5WOS1i8tAkje90Eu96K4PrcPcPD3W5R7JEVzL1mxLTzfbfirRDLV7Pj3AmM\n Ho2hhzX6h+1tkmuzV6pjShWa9CxSe7UqlQIRlCLKhTggSnKXMC5M55ezucaqFc9Fxz9hVx7Nl9y\n KDGD92XnUMO4T1jiDy0hnqPXkCS3weifajxoOEgCW1", "X-Gm-Gg": "AeBDiev0tzSyC9ay5rODWvIWILIJlghOgm++t0S5hzCBGb7xTLtiZbSb8h7BdsATf3H\n nYlpwUNBMOLOAwBj6RZOkqb/MMPMmLAsUvG4vDrBoubFNGy6bPbNXoCs9cqKQF8oP8zOBkktNrP\n NudxVayXKQwYMCogPRdyVbS5LB+rsEnfE91NkGXO1AgNXMUft9MzU+kJSnR9d2y5jEepvCzIIjH\n FLFlYOEUE3nldP767iRK5PAr1HaT5TRsXqWD/1Dqay1V/vKpOyQgAbRS6tK1RxO4t4FbdZluNrA\n +yLu0cD4fa+Fven8yIvWj7rDjUTrT9/Qgyls7MasdgBgp7ceomHkceolSJtW0w28XzxiNXPCKvv\n WXDEFth6h5PJa", "X-Received": [ "by 2002:ac8:588a:0:b0:50b:2f83:b702 with SMTP id\n d75a77b69052e-50dd5c4f080mr193226661cf.6.1776196455198;\n Tue, 14 Apr 2026 12:54:15 -0700 (PDT)", "by 2002:ac8:588a:0:b0:50b:2f83:b702 with SMTP id\n d75a77b69052e-50dd5c4f080mr193226251cf.6.1776196454520;\n Tue, 14 Apr 2026 12:54:14 -0700 (PDT)" ], "From": "Patrick Palka <ppalka@redhat.com>", "To": "gcc-patches@gcc.gnu.org", "Cc": "jason@redhat.com,\n\tpolacek@redhat.com,\n\tPatrick Palka <ppalka@redhat.com>", "Subject": "[PATCH] c++: identity of A<^^alias> [PR124544]", "Date": "Tue, 14 Apr 2026 15:54:12 -0400", "Message-ID": "<20260414195412.221509-1-ppalka@redhat.com>", "X-Mailer": "git-send-email 2.54.0.rc1.54.g60f07c4f5c", "MIME-Version": "1.0", "X-Mimecast-Spam-Score": "0", "X-Mimecast-MFC-PROC-ID": "7j3ha8U68NbgUy4ViHhzgh4MGSybFAmgVPPmXpKR7dM_1776196456", "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": "Tested on x86-64-pc-linux-gnu, does this look OK for trunk?\n\n-- >8 --\n\nSince a reflection of an alias represents the alias itself, not the\nunderlying type, equality of two such reflections needs to take that\ninto account. And don't strip such aliases when forming a\nspecialization A<^^alias>.\n\n\tPR c++/124544\n\ngcc/cp/ChangeLog:\n\n\t* tree.cc (strip_typedefs_expr) <case REFLECT_EXPR>: Don't strip\n\ttypedefs within a type operand.\n\t(cp_tree_equal) <case REFLECT_EXPR>: For a reflection of an\n\talias, also compare TYPE_NAMEs directly.\n\ngcc/testsuite/ChangeLog:\n\n\t* g++.dg/reflect/alias1.C: New test.\n\t* g++.dg/reflect/alias2.C: New test.\n---\n gcc/cp/tree.cc | 22 ++++++++++++++++++----\n gcc/testsuite/g++.dg/reflect/alias1.C | 26 ++++++++++++++++++++++++++\n gcc/testsuite/g++.dg/reflect/alias2.C | 17 +++++++++++++++++\n 3 files changed, 61 insertions(+), 4 deletions(-)\n create mode 100644 gcc/testsuite/g++.dg/reflect/alias1.C\n create mode 100644 gcc/testsuite/g++.dg/reflect/alias2.C", "diff": "diff --git a/gcc/cp/tree.cc b/gcc/cp/tree.cc\nindex ff2e78cd89cf..d12ebc0f25e1 100644\n--- a/gcc/cp/tree.cc\n+++ b/gcc/cp/tree.cc\n@@ -2155,6 +2155,11 @@ strip_typedefs_expr (tree t, bool *remove_attributes, unsigned int flags)\n case STMT_EXPR:\n return t;\n \n+ case REFLECT_EXPR:\n+ /* ^^alias represents the alias itself, not the underlying type. */\n+ if (TYPE_P (TREE_OPERAND (t, 0)))\n+\treturn t;\n+\n default:\n break;\n }\n@@ -4510,10 +4515,19 @@ cp_tree_equal (tree t1, tree t2)\n return true;\n \n case REFLECT_EXPR:\n- if (!cp_tree_equal (REFLECT_EXPR_HANDLE (t1), REFLECT_EXPR_HANDLE (t2))\n-\t || REFLECT_EXPR_KIND (t1) != REFLECT_EXPR_KIND (t2))\n-\treturn false;\n- return true;\n+ {\n+\ttree h1 = REFLECT_EXPR_HANDLE (t1);\n+\ttree h2 = REFLECT_EXPR_HANDLE (t2);\n+\tif (!cp_tree_equal (h1, h2)\n+\t || REFLECT_EXPR_KIND (t1) != REFLECT_EXPR_KIND (t2))\n+\t return false;\n+\t/* ^^alias represents the alias itself, not the underlying type. */\n+\tif (TYPE_P (h1)\n+\t && (typedef_variant_p (h1) || typedef_variant_p (h2))\n+\t && TYPE_NAME (h1) != TYPE_NAME (h2))\n+\t return false;\n+\treturn true;\n+ }\n \n default:\n break;\ndiff --git a/gcc/testsuite/g++.dg/reflect/alias1.C b/gcc/testsuite/g++.dg/reflect/alias1.C\nnew file mode 100644\nindex 000000000000..d77fd9f2a978\n--- /dev/null\n+++ b/gcc/testsuite/g++.dg/reflect/alias1.C\n@@ -0,0 +1,26 @@\n+// PR c++/124544\n+// { dg-do compile { target c++26 } }\n+// { dg-additional-options \"-freflection\" }\n+\n+using alias = int;\n+template<class> using alias_t = int;\n+\n+template<auto> struct A { };\n+static_assert( ! __is_same(A<^^int>, A<^^alias>) );\n+static_assert( ! __is_same(A<^^int>, A<^^alias_t<int>>) );\n+static_assert( ! __is_same(A<^^alias>, A<^^alias_t<int>>) );\n+static_assert( ! __is_same(A<^^alias_t<char>>, A<^^alias_t<int>>) );\n+static_assert( __is_same(A<^^alias_t<alias>>, A<^^alias_t<int>>) );\n+\n+template<class> struct B { };\n+static_assert( __is_same(A<^^B<alias>>, A<^^B<int>>) );\n+\n+template<auto> int V;\n+static_assert( &V<^^int> != &V<^^alias_t<int>> );\n+static_assert( &V<^^int> != &V<^^alias> );\n+static_assert( &V<^^alias_t<int>> != &V<^^alias_t<char>> );\n+\n+template<auto> void f();\n+static_assert( &f<^^int> != &f<^^alias_t<int>> );\n+static_assert( &f<^^int> != &f<^^alias> );\n+static_assert( &f<^^alias_t<int>> != &f<^^alias_t<char>> );\ndiff --git a/gcc/testsuite/g++.dg/reflect/alias2.C b/gcc/testsuite/g++.dg/reflect/alias2.C\nnew file mode 100644\nindex 000000000000..c32a8724a9ba\n--- /dev/null\n+++ b/gcc/testsuite/g++.dg/reflect/alias2.C\n@@ -0,0 +1,17 @@\n+// PR c++/124544\n+// { dg-do compile { target c++26 } }\n+// { dg-additional-options \"-freflection\" }\n+\n+template<auto, class> struct A;\n+\n+template<auto V>\n+struct A<V, char> {\n+ static void f();\n+};\n+\n+template<class T> using alias_t = T;\n+\n+int main() {\n+ A<^^int, char>::f();\n+ A<^^alias_t<int>, char>::f();\n+}\n", "prefixes": [] }