Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2217339/?format=api
{ "id": 2217339, "url": "http://patchwork.ozlabs.org/api/patches/2217339/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260327221949.915890-1-polacek@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": "<20260327221949.915890-1-polacek@redhat.com>", "list_archive_url": null, "date": "2026-03-27T22:19:49", "name": "c++/reflection: static memfn templs of class templs [PR124617]", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "e2ad541b960178356d4c72956f8f53278b806b10", "submitter": { "id": 14370, "url": "http://patchwork.ozlabs.org/api/people/14370/?format=api", "name": "Marek Polacek", "email": "polacek@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260327221949.915890-1-polacek@redhat.com/mbox/", "series": [ { "id": 497840, "url": "http://patchwork.ozlabs.org/api/series/497840/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=497840", "date": "2026-03-27T22:19:49", "name": "c++/reflection: static memfn templs of class templs [PR124617]", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/497840/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2217339/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2217339/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=cTTv2yku;\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=cTTv2yku", "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 4fjFTC2gT3z1y0D\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 28 Mar 2026 09:20:31 +1100 (AEDT)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id ED2A84BA23EE\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 27 Mar 2026 22:20:28 +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 1B2004BA23D3\n for <gcc-patches@gcc.gnu.org>; Fri, 27 Mar 2026 22:20:01 +0000 (GMT)", "from mx-prod-mc-05.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-156-rCMlLIwvM5WElr2a3OAXGQ-1; Fri,\n 27 Mar 2026 18:19:57 -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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 1945B195608A\n for <gcc-patches@gcc.gnu.org>; Fri, 27 Mar 2026 22:19:56 +0000 (UTC)", "from pdp-11.lan (unknown [10.22.65.13])\n by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 634AB1800760; Fri, 27 Mar 2026 22:19:55 +0000 (UTC)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org ED2A84BA23EE", "OpenDKIM Filter v2.11.0 sourceware.org 1B2004BA23D3" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 1B2004BA23D3", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 1B2004BA23D3", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1774650001; cv=none;\n b=PzKL4EJYZ/6a3lyrvLerPPTMkJGNyc4BLbf4fadrdhSCeHqerrmU7mmci7v1LQk48MhvdxQkc4fim0RqL5eBmgjuDZbj4BLZhu5a4F5Lgx0kPCuWM+MBxR3XjIMSc93d89B5gA2prOuM6kiEKgkXh/G9FEW9mxTnThsU+kwgAK8=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1774650001; c=relaxed/simple;\n bh=ENNfsyycnQfoSSRNEsGj0ytIjVCzjT7Idga51OYUhyY=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=sfbt4hPB5Y2jmvWHrWGZDpexFhpex7rL6FIR+EUatCRBXdQTjTCpMRc/vw50FH8C5aJXl1L5SVhA7IqXAtku/yobS/FLbX91RavFEnzti8B7Bz5wtOKG+KVma7SdKHgxHYoD4szryMaulCZWR6NRUSxU8kfT5tsAS/9D3nWSCjA=", "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=1774650000;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=X3xC1oEYzc7+9Xf5iLfTl4R/ADUezgvLDUxoZtUGEFU=;\n b=cTTv2ykuCHjUplm7SVfnib8NbKTvszKAQmElzjYHYWuYgfqoOYBmF9la0vbYgZxR2ExhIV\n xH87TXkwR38RXTnXzjfkwl24ywecnl8Dd4pnJ9vDZYevjB7Q5iFNRsAmCoQ+ibAz362co5\n 8ZPbaC18W59M8SXUAQYsrodNMJRmsFQ=", "X-MC-Unique": "rCMlLIwvM5WElr2a3OAXGQ-1", "X-Mimecast-MFC-AGG-ID": "rCMlLIwvM5WElr2a3OAXGQ_1774649996", "From": "Marek Polacek <polacek@redhat.com>", "To": "GCC Patches <gcc-patches@gcc.gnu.org>,\n\tJason Merrill <jason@redhat.com>", "Subject": "[PATCH] c++/reflection: static memfn templs of class templs\n [PR124617]", "Date": "Fri, 27 Mar 2026 18:19:49 -0400", "Message-ID": "<20260327221949.915890-1-polacek@redhat.com>", "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": "D3f0qLU0P9cleKsmWGvdBoZBwWee5zpu98QqOG2wed8_1774649996", "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/regtested on x86_64-pc-linux-gnu, ok for trunk?\n\n-- >8 --\nHere meta::extract either wrongly throws or we crash. The problem is\nthat it got a partial specialization, with which it can't do much.\n\nWhen we have\n\n template <class F>\n struct S {\n template <int I>\n static constexpr int visit(F&&) { return 42; }\n\n static constexpr std::meta::info fptrs = ^^visit<0>;\n };\n\nand do get_reflection -> resolve_nondeduced_context for ^^visit<0>,\nwe should already have substituted F, otherwise we only substitute\nI with 0 and are left with a partial specialization. F should have\nbeen substituted in tsubst_expr/REFLECT_EXPR, but the reflection is\n\n REFLECT_EXPR<TEMPLATE_ID_EXPR<OVERLOAD, 0>>\n\nand tsubst_expr doesn't do much with an OVERLOAD. This thing should\nbe\n\n REFLECT_EXPR<BASELINK<TEMPLATE_ID_EXPR<OVERLOAD, 0>>>\n\nso that we go to tsubst_baselink and properly substitute the\nTEMPLATE_DECL in the OVERLOAD.\n\ncp_parser_reflect_expression doesn't call finish_id_expression which\nwould add the BASELINK for reason mentioned in the comment there. So\nI think we can do the following: just call baselink_for_fns to create\nthe BASELINK if needed.\n\n\tPR c++/124617\n\ngcc/cp/ChangeLog:\n\n\t* parser.cc (cp_parser_reflect_expression): Call baselink_for_fns.\n\ngcc/testsuite/ChangeLog:\n\n\t* g++.dg/reflect/dep12.C: New test.\n\t* g++.dg/reflect/dep13.C: New test.\n---\n gcc/cp/parser.cc | 2 ++\n gcc/testsuite/g++.dg/reflect/dep12.C | 15 +++++++++++++++\n gcc/testsuite/g++.dg/reflect/dep13.C | 25 +++++++++++++++++++++++++\n 3 files changed, 42 insertions(+)\n create mode 100644 gcc/testsuite/g++.dg/reflect/dep12.C\n create mode 100644 gcc/testsuite/g++.dg/reflect/dep13.C\n\n\nbase-commit: c2203f9b2153f7a5a512cdb91135f728fe1851af", "diff": "diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc\nindex 8d88dc9c312..34c88be8beb 100644\n--- a/gcc/cp/parser.cc\n+++ b/gcc/cp/parser.cc\n@@ -10185,6 +10185,8 @@ cp_parser_reflect_expression (cp_parser *parser)\n \t&& variable_template_p (TREE_OPERAND (t, 0))\n \t&& !concept_check_p (t))\n t = finish_template_variable (t);\n+ else if (is_overloaded_fn (t))\n+ t = baselink_for_fns (t);\n if (cp_parser_parse_definitely (parser))\n return get_reflection (loc, t);\n }\ndiff --git a/gcc/testsuite/g++.dg/reflect/dep12.C b/gcc/testsuite/g++.dg/reflect/dep12.C\nnew file mode 100644\nindex 00000000000..22dfc37b48b\n--- /dev/null\n+++ b/gcc/testsuite/g++.dg/reflect/dep12.C\n@@ -0,0 +1,15 @@\n+// PR c++/124617\n+// { dg-do compile { target c++26 } }\n+// { dg-additional-options \"-freflection\" }\n+\n+#include <meta>\n+\n+template <class T>\n+struct S {\n+ template <class U>\n+ static void f() {}\n+\n+ static constexpr auto p = ^^f<int>;\n+};\n+\n+constexpr void (*p)() = extract<void(*)()>(S<int>::p);\ndiff --git a/gcc/testsuite/g++.dg/reflect/dep13.C b/gcc/testsuite/g++.dg/reflect/dep13.C\nnew file mode 100644\nindex 00000000000..8d262a4a878\n--- /dev/null\n+++ b/gcc/testsuite/g++.dg/reflect/dep13.C\n@@ -0,0 +1,25 @@\n+// PR c++/124617\n+// { dg-do compile { target c++26 } }\n+// { dg-additional-options \"-freflection\" }\n+\n+#include <meta>\n+\n+template <class F>\n+struct S {\n+ template <int I>\n+ static constexpr int visit(F&&) { return 42; }\n+\n+ using Ptr = decltype(&visit<0>);\n+ static constexpr std::meta::info fptrs = ^^visit<0>;\n+};\n+\n+template <class F>\n+constexpr int foo(F&& f) {\n+ using Impl = S<F>;\n+ auto which = Impl::fptrs;\n+ auto func = std::meta::extract<typename Impl::Ptr>(which);\n+ return func((F&&)f);\n+}\n+\n+struct Plus { };\n+static_assert(foo(Plus{}) == 42);\n", "prefixes": [] }