Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2218273/?format=api
{ "id": 2218273, "url": "http://patchwork.ozlabs.org/api/patches/2218273/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/acw1Ja3cZ0iaWnKu@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": "<acw1Ja3cZ0iaWnKu@redhat.com>", "list_archive_url": null, "date": "2026-03-31T20:57:09", "name": "[v2] c++/reflection: spurious error with constrained return types [PR124457]", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "dabf38af10e23a4a0e1a7eb341a942036c817f04", "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/acw1Ja3cZ0iaWnKu@redhat.com/mbox/", "series": [ { "id": 498250, "url": "http://patchwork.ozlabs.org/api/series/498250/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=498250", "date": "2026-03-31T20:57:09", "name": "[v2] c++/reflection: spurious error with constrained return types [PR124457]", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/498250/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2218273/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2218273/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=BWwlyCfj;\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=BWwlyCfj", "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 4flgRv5DdCz1yCp\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 07:57:46 +1100 (AEDT)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 746394BA23F3\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 20:57:44 +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 D2BB14BA2E26\n for <gcc-patches@gcc.gnu.org>; Tue, 31 Mar 2026 20:57:14 +0000 (GMT)", "from mail-qk1-f200.google.com (mail-qk1-f200.google.com\n [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-48-7SWcxmSYOveEQhZbwhoXrA-1; Tue, 31 Mar 2026 16:57:13 -0400", "by mail-qk1-f200.google.com with SMTP id\n af79cd13be357-8cdb995a1bfso1824597785a.1\n for <gcc-patches@gcc.gnu.org>; Tue, 31 Mar 2026 13:57:13 -0700 (PDT)", "from redhat.com ([2603:7000:9500:10::1db4])\n by smtp.gmail.com with ESMTPSA id\n 6a1803df08f44-89f49cbb8besm89875386d6.43.2026.03.31.13.57.10\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 31 Mar 2026 13:57:10 -0700 (PDT)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 746394BA23F3", "OpenDKIM Filter v2.11.0 sourceware.org D2BB14BA2E26" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org D2BB14BA2E26", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org D2BB14BA2E26", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1774990634; cv=none;\n b=YUnRURZ82d0ah8F6lFx5ZkRTIe3Gy4InTN4S4TZvUMTNH84At+amlh1HEV7GJL+cif3PA/fM9OIIFTaup+4VSHkG8Q5TXfhUeBkr4GUVtip0e0O2l8/vKLEbluNeVMeu0nwvvfNTBV3IIIKN/ZWcUXwHbVl83rRJ/+eRokR1Mbs=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1774990634; c=relaxed/simple;\n bh=FEQ1NzgucTml73MRc9QJeTseaqPCyQmFEUO6rTqkyig=;\n h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version;\n b=SiXBIaubs1SLz4ukKDraW2GwHR/FyXkld4LyB1eiBOBz6ZZGuZh42uAdMBujoc+y0S8elbeVtlzYlemXyEif571cRAeMwkFmnGRxZGPshddNNsnNbutJzRL2EiZVNxEf5PYpe1sCRFUceNq7aP1T3YNNIMOU/k6GsW0X4FQBIro=", "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=1774990634;\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 in-reply-to:in-reply-to:references:references;\n bh=a4BAFPcAihM1+y1GT44b6ejy9RFYL1lEy5Kmu7OrW4c=;\n b=BWwlyCfji8m3NwiBHxf32HlBf1utbLc6unGBPio4xgZJGAWw4nxEVvFHLnh9hjo2DrZMZM\n qZwiorcQkpvRsrCKOwqc38ENw1W3GAxME13yzxH5ka4wY3DaiSatU3UPFv/2PCHR8530F8\n RCo8eM9TRQEybr72PrCTkgRO6w9Br6k=", "X-MC-Unique": "7SWcxmSYOveEQhZbwhoXrA-1", "X-Mimecast-MFC-AGG-ID": "7SWcxmSYOveEQhZbwhoXrA_1774990633", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774990632; x=1775595432;\n h=user-agent:in-reply-to:content-disposition:mime-version:references\n :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=a4BAFPcAihM1+y1GT44b6ejy9RFYL1lEy5Kmu7OrW4c=;\n b=sB0a2ffsUPuSwvLgGGT2/9fL3IbPCx6s6EeHIbfi1NbEv8BhQ3fD/GXhpiMaUTclON\n HKUWm066uXor2HQTIXW9A2NHVAXZfpXrnp7fQfkaeoaRofmEXMQH1pBlj/NeIZjnuIX3\n EsUY7PfTUM1pMX7Ioq+TyxilzEVk2It94Onkt8kfTsnYtxy9vYLN3ARe0FqVkTrckcvo\n GejHh/80zyEGvVQQJtGYAmI4HclPu2n1Ul35vu8ZCteaWTfT+JdEO8+J8FOikGRBFMQ9\n rFav7cI3XAVG43OI1d0v/6WO1Cs8deYd9mFGkSClDCg1kwBNg3h7xNDajw0dqtcLqEER\n z6Qw==", "X-Gm-Message-State": "AOJu0Yx2faSSKZMHQRPpmbSsKKEgjX6ErmDYHpUZ/fSsb6rjaik5+YMN\n fzLHIAW19HDILn3je/rNPhJnHuVrTGS3O2WdDjGYkSIk8kT9DcvSztJJ11s7M9bIbg8XqDtQeHm\n tDeDhWCKMWJopbswYHEng3g6zu75JsaFoJ6t4+jTtz3mbb42iTMZQ0DAZYcIhgWrMtK4=", "X-Gm-Gg": "ATEYQzx6fMwT00AkODPpHTF+Tl//N7+ZXDeEw0UsXCSdSK7BtkbeTOhtJ0O3usgtS99\n jhdVPqEX5dL0wo1LfS3ZJPaIf6OqpPnH+4y9806fXgClepfcE+jenOJff0whH207vDwPrTpw9Ac\n Vc/JImYQu7kGDP/WC+ME21EmX1J69ohz9npMknVfrZKTWcaH5cJbiFtFhM4GzCpJyoPBGUlhDP+\n cgu4eWS2L1S2AbIdJNdB5qqFCpBvUIl/gf/Cid2OjoVzr5tUR7cKp8Z2Aaa+4ZaogXd+16mshvj\n GSeif6Qzt69jImSXCdTHJauDj0mgiXGnmbshQv3zcvRlSF1tSG/2F9y977LZ/03Iy4xT+Pr47O5\n sJQ==", "X-Received": [ "by 2002:a05:620a:444d:b0:8cf:c218:1d01 with SMTP id\n af79cd13be357-8d1b5c17c84mr187341885a.48.1774990632128;\n Tue, 31 Mar 2026 13:57:12 -0700 (PDT)", "by 2002:a05:620a:444d:b0:8cf:c218:1d01 with SMTP id\n af79cd13be357-8d1b5c17c84mr187338385a.48.1774990631549;\n Tue, 31 Mar 2026 13:57:11 -0700 (PDT)" ], "Date": "Tue, 31 Mar 2026 16:57:09 -0400", "From": "Marek Polacek <polacek@redhat.com>", "To": "Patrick Palka <ppalka@redhat.com>", "Cc": "GCC Patches <gcc-patches@gcc.gnu.org>, Jason Merrill <jason@redhat.com>", "Subject": "[PATCH v2] c++/reflection: spurious error with constrained return\n types [PR124457]", "Message-ID": "<acw1Ja3cZ0iaWnKu@redhat.com>", "References": "<20260330211206.766668-1-polacek@redhat.com>\n <d27c8b19-415b-9876-5c90-a92f5e2cdaf0@idea>", "MIME-Version": "1.0", "In-Reply-To": "<d27c8b19-415b-9876-5c90-a92f5e2cdaf0@idea>", "User-Agent": "Mutt/2.3.1 (2026-03-20)", "X-Mimecast-Spam-Score": "0", "X-Mimecast-MFC-PROC-ID": "yFOFeGLBRx0OtZaF7fb7dtPYLXTCTwJAGeIZJDwYuD0_1774990633", "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>", "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org" }, "content": "On Mon, Mar 30, 2026 at 06:01:16PM -0400, Patrick Palka wrote:\n> On Mon, 30 Mar 2026, Marek Polacek wrote:\n> \n> > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk?\n> > \n> > -- >8 --\n> > Here we are emitting a bogus error in get_reflection because it\n> > got something for which is_auto was true: the constrained auto\n> > coming from make_constrained_auto.\n> \n> Could we move the auto check/diagnostic from get_reflection to only\n> the parser? IIUC the intent of [expr.reflect]/6.1 is to treat\n> ^^auto as invalid syntactically.\n\nI suppose I could, thanks. I don't love moving the check out of\nget_reflection but I guess it's safer than changing the identifier.\n\nAlso fixed a missing '}' in the test.\n\nBootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk?\n\n-- >8 --\nHere we are emitting a bogus error in get_reflection because it\ngot something for which is_auto was true: the constrained auto\ncoming from make_constrained_auto. We represent the\nreturn-type-requirement as a constrained auto which is in fact\na placeholder, but in this case we don't want the error.\n\nWe can move the error from get_reflection to the parser to avoid\nemitting the error.\n\n\tPR c++/124457\n\ngcc/cp/ChangeLog:\n\n\t* parser.cc (cp_parser_reflect_expression): Check is_auto here\n\tinstead of...\n\t* reflect.cc (get_reflection): ...here.\n\ngcc/testsuite/ChangeLog:\n\n\t* g++.dg/reflect/concept1.C: New test.\n---\n gcc/cp/parser.cc | 9 +++++++++\n gcc/cp/reflect.cc | 9 +--------\n gcc/testsuite/g++.dg/reflect/concept1.C | 14 ++++++++++++++\n 3 files changed, 24 insertions(+), 8 deletions(-)\n create mode 100644 gcc/testsuite/g++.dg/reflect/concept1.C\n\n\nbase-commit: 1bd1e824fc17e8adba83fd1317786aacd53457d9", "diff": "diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc\nindex 8d88dc9c312..e14674607d7 100644\n--- a/gcc/cp/parser.cc\n+++ b/gcc/cp/parser.cc\n@@ -10150,6 +10150,15 @@ cp_parser_reflect_expression (cp_parser *parser)\n \t ^^B <int> is a type alias though. */\n if (TYPE_P (t) && !type_alias_p)\n \tt = strip_typedefs (t);\n+ /* [expr.reflect] If the type-id designates a placeholder type, R is\n+\t ill-formed. This check is here rather than in get_reflection so\n+\t that we don't wrongly error for a return-type-requirement which is\n+\t represented as a constrained auto. */\n+ if (is_auto (t))\n+\t{\n+\t error_at (loc, \"%<^^%> cannot be applied to a placeholder type\");\n+\t return error_mark_node;\n+\t}\n return get_reflection (loc, t);\n }\n /* Try an id-expression. */\ndiff --git a/gcc/cp/reflect.cc b/gcc/cp/reflect.cc\nindex 405790d5f35..0b5fd64b6cd 100644\n--- a/gcc/cp/reflect.cc\n+++ b/gcc/cp/reflect.cc\n@@ -123,16 +123,9 @@ get_reflection (location_t loc, tree t, reflect_kind kind/*=REFLECT_UNDEF*/)\n {\n STRIP_ANY_LOCATION_WRAPPER (t);\n \n- /* [expr.reflect] If the type-id designates a placeholder type, R is\n- ill-formed. */\n- if (is_auto (t))\n- {\n- error_at (loc, \"%<^^%> cannot be applied to a placeholder type\");\n- return error_mark_node;\n- }\n /* Constant template parameters and pack-index-expressions cannot\n appear as operands of the reflection operator. */\n- else if (PACK_INDEX_P (t))\n+ if (PACK_INDEX_P (t))\n {\n error_at (loc, \"%<^^%> cannot be applied to a pack index\");\n return error_mark_node;\ndiff --git a/gcc/testsuite/g++.dg/reflect/concept1.C b/gcc/testsuite/g++.dg/reflect/concept1.C\nnew file mode 100644\nindex 00000000000..2f3d475432a\n--- /dev/null\n+++ b/gcc/testsuite/g++.dg/reflect/concept1.C\n@@ -0,0 +1,14 @@\n+// PR c++/124457\n+// { dg-do compile { target c++26 } }\n+// { dg-additional-options \"-freflection\" }\n+\n+template <class T, auto t = ^^T>\n+concept True = true;\n+\n+template <class T>\n+concept AlsoTrue = requires (T t) {\n+ { t } -> True;\n+};\n+void f1(True auto x);\n+template <True T> void f2(T );\n+auto f3(int) -> True auto;\n", "prefixes": [ "v2" ] }