Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2226671/?format=api
{ "id": 2226671, "url": "http://patchwork.ozlabs.org/api/patches/2226671/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/aekPzv3Jab_Gm0sk@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": "<aekPzv3Jab_Gm0sk@redhat.com>", "list_archive_url": null, "date": "2026-04-22T18:13:34", "name": "[v2] c++/reflection: reflect on dependent class template [PR124926]", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "f0f61fbaccd519760c62dd26439fdd98f7af0d1f", "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/aekPzv3Jab_Gm0sk@redhat.com/mbox/", "series": [ { "id": 501069, "url": "http://patchwork.ozlabs.org/api/series/501069/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=501069", "date": "2026-04-22T18:13:34", "name": "[v2] c++/reflection: reflect on dependent class template [PR124926]", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/501069/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2226671/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2226671/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=bU9vQp9i;\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=bU9vQp9i", "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 [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 4g16rz3hJzz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 04:17:39 +1000 (AEST)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id A62B048FEDB7\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 18:17:37 +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 AAE3B4BBCD8C\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 18:13:45 +0000 (GMT)", "from mail-qk1-f199.google.com (mail-qk1-f199.google.com\n [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-21-d-Tqz5nePEyQhk1-I36IGQ-1; Wed, 22 Apr 2026 14:13:39 -0400", "by mail-qk1-f199.google.com with SMTP id\n af79cd13be357-8eb52a22e85so808200385a.2\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 11:13:38 -0700 (PDT)", "from redhat.com ([2603:7002:1f00:31d2::1db4])\n by smtp.gmail.com with ESMTPSA id\n af79cd13be357-8e7d8edb795sm1397111285a.25.2026.04.22.11.13.35\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 22 Apr 2026 11:13:36 -0700 (PDT)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org A62B048FEDB7", "OpenDKIM Filter v2.11.0 sourceware.org AAE3B4BBCD8C" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org AAE3B4BBCD8C", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org AAE3B4BBCD8C", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776881625; cv=none;\n b=GXv2kqgNwK84JSCBtc9/o011TQs0kOWJ7lBddDqOopU4Tros6oTSF0V91HKFU5ZEXRVcUgDrDGB7RshTmd9tYfcBIQAqDEWYaRdqySMB7AbHwbaOkppPeqjOJTGECgz75+IjQgCnuSt2skggqIbA4NeWy3rydkl7dOPkgxPAm+k=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776881625; c=relaxed/simple;\n bh=CPBY8TBoCdrVcrQ+a84VsQC6y0TJPCMwBOZGKsnl7EQ=;\n h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version;\n b=BYM/kUsjDZ52hUYZiI3jhLRxYReutMABlt5F7ez03swqxwBqeNjwzDy2T1D60NMyp9GIqvnBeGj6UHKzx3EiKF2pk2S7jsG1gUPY0e5L5uAPNVIhBZn2RzbPhRhryfWUN2sErIxFnNTALux0y42CRKWlX56bEuBgN1Xsuo/mons=", "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=1776881625;\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=HL1PEp1Wum1xCl4Ey4KTKZnCcR3+TC0ua2plRCMCfOk=;\n b=bU9vQp9i/CjHecWvPmajHGb82l0xsIxi9mrDEXFltp8IQCwkVDc4IssQUlPykjjqdLwSsO\n XWxNeGLZzIdMfteMwvjhEH8jPN8ldHsEPPWSD/Zz5vbC7OQxiqOEXJKgTDfPJBz8dI7Z1e\n thsnRUh31MJEYFX7b6o8eyofkauMLwE=", "X-MC-Unique": "d-Tqz5nePEyQhk1-I36IGQ-1", "X-Mimecast-MFC-AGG-ID": "d-Tqz5nePEyQhk1-I36IGQ_1776881618", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776881617; x=1777486417;\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=HL1PEp1Wum1xCl4Ey4KTKZnCcR3+TC0ua2plRCMCfOk=;\n b=fdJfMdTaLmFbtN4grevQMcgDpgNc8o6fm61//lelRG4WOiaZRhC6ory6huC0f7fBZV\n 8bb/+bRTtI3I1pQLWURRbW0p1uZhYMgLBHWAE6LFJc6+ot+9IIu/vNFUOZ67SCQ1Gkq/\n 0MUJOSMKr3ZAwk79N76UhWY+eJYtM7iZxxMAazYKyDQbliBkb4H2BZjYWlKF0/yl8mbe\n U6tTnQxEtNRBHLzJ/wf30sdA385zFr0w4bD+vUASXQjkO8wtRKflxJ6fmfRHdquWFp+Z\n QRHqJALv7CHR/vdsIdlp1rFfey/eU2xrNFm9hQJ/Qh0yrj+KIJqQNFzat1BuGjbV9NGP\n hgtw==", "X-Gm-Message-State": "AOJu0Yy+0XV32HzsFHC/OS6g7i+oF+Lf0Cq9J8fIU//M+kdrM5ODpVxa\n 9cculXCfIDqSoKQHDvXPGeDlALomJSORS+bMBw/jyhjQbD9zytitQj1JiqzSq0j7eTFE7X0w7/P\n rrtlddqvjMeO1DE7SbR/g1yDtNh16hbfZ6te1rgetVfZuI0zCW6Pgx+A1y0/CQzi12Ek=", "X-Gm-Gg": "AeBDieuhcOrwyFRuZxFCYELTuZj+FxH8/JOkopoW2PmRkVfy4mdaPk+nN7nDrPcd/0x\n XO8QPwDoKpzavuoz6fDqIuUfLQAtp2UNPiJqcI9nPircdaP/0UNq7bReHLXaNEdbRPzy/BNt2iw\n 93OvqAXfs9QPiGGoSNCmuYyG/PauNPSXPY6GZOhzizy5QLXzRJmjMDfB8KFVgV0nLdCjBTJRjt2\n NOR9FG+Wxo6mKPAqeN6dW3O0Hli182GeXsheUxVH8gPyop6NEIvD4IjfsDpIBmiKVwtBgvBBg0h\n cPTZKSj1s/vQndeUT/c1mWrHMHbl5xkdLISc5JOAu7CwoTymcR5L1WtYuH1E1hs3A6KsBNpY5jj\n uW8Keg/sBko25soo=", "X-Received": [ "by 2002:a05:620a:c54:b0:8d7:f950:ea4a with SMTP id\n af79cd13be357-8e78f253d7emr3670719085a.12.1776881617151;\n Wed, 22 Apr 2026 11:13:37 -0700 (PDT)", "by 2002:a05:620a:c54:b0:8d7:f950:ea4a with SMTP id\n af79cd13be357-8e78f253d7emr3670714685a.12.1776881616620;\n Wed, 22 Apr 2026 11:13:36 -0700 (PDT)" ], "Date": "Wed, 22 Apr 2026 14:13:34 -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: reflect on dependent class template\n [PR124926]", "Message-ID": "<aekPzv3Jab_Gm0sk@redhat.com>", "References": "<20260422172510.801133-1-polacek@redhat.com>\n <0ee0590a-3c48-6588-dfdf-10ed0fd511fb@idea>", "MIME-Version": "1.0", "In-Reply-To": "<0ee0590a-3c48-6588-dfdf-10ed0fd511fb@idea>", "User-Agent": "Mutt/2.3.1 (2026-03-20)", "X-Mimecast-Spam-Score": "0", "X-Mimecast-MFC-PROC-ID": "y9glPNqCyuBoWFNxWo9tHxqDkjesC-YucE5bL38aQyI_1776881618", "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 Wed, Apr 22, 2026 at 01:43:30PM -0400, Patrick Palka wrote:\n> On Wed, 22 Apr 2026, Marek Polacek wrote:\n> \n> > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk?\n> > \n> > -- >8 --\n> > Here we issue a bogus error for\n> > \n> > ^^Cls<T>::template Inner\n> > \n> > where Inner turns out to be a class type, but we created a SCOPE_REF\n> > because we can't know in advance what it will substitute into, and\n> > \n> > ^^typename Cls<T>::template Inner\n> > \n> > is invalid. The typename can only be used in\n> > \n> > ^^typename Cls<T>::template Inner<int>\n> > \n> > We're taking a reflection so both types and non-types are valid, so\n> > I think we shouldn't give the error for ^^, and take the reflection\n> > of the TEMPLATE_DECL.\n> > \n> > \tPR c++/124926\n> > \n> > gcc/cp/ChangeLog:\n> > \n> > \t* pt.cc (tsubst_qualified_id): New bool parameter. Don't give the\n> > \t\"instantiation yields a type\" error when the new parameter is true.\n> > \t(tsubst_expr) <case REFLECT_EXPR>: Adjust the call to\n> > \ttsubst_qualified_id.\n> > \n> > gcc/testsuite/ChangeLog:\n> > \n> > \t* g++.dg/reflect/dep15.C: New test.\n> > ---\n> > gcc/cp/pt.cc | 13 +++--\n> > gcc/testsuite/g++.dg/reflect/dep15.C | 85 ++++++++++++++++++++++++++++\n> > 2 files changed, 94 insertions(+), 4 deletions(-)\n> > create mode 100644 gcc/testsuite/g++.dg/reflect/dep15.C\n> > \n> > diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc\n> > index 5d97ca7997f..f73805b2557 100644\n> > --- a/gcc/cp/pt.cc\n> > +++ b/gcc/cp/pt.cc\n> > @@ -18238,12 +18238,14 @@ tsubst_baselink (tree baselink, tree object_type,\n> > true if the qualified-id will be a postfix-expression in-and-of\n> > itself; false if more of the postfix-expression follows the\n> > QUALIFIED_ID. ADDRESS_P is true if the qualified-id is the operand\n> > - of \"&\". NAME_LOOKUP_P is true if we intend to perform name lookup. */\n> > + of \"&\". NAME_LOOKUP_P is true if we intend to perform name lookup.\n> > + REFLECTING_P is true if this SCOPE_REF is an operand of ^^. */\n> > \n> > static tree\n> > tsubst_qualified_id (tree qualified_id, tree args,\n> > \t\t tsubst_flags_t complain, tree in_decl,\n> > -\t\t bool done, bool address_p, bool name_lookup_p = true)\n> > +\t\t bool done, bool address_p, bool name_lookup_p = true,\n> > +\t\t bool reflecting_p = false)\n> > {\n> > tree expr;\n> > tree scope;\n> > @@ -18322,7 +18324,9 @@ tsubst_qualified_id (tree qualified_id, tree args,\n> > else\n> > \texpr = lookup_qualified_name (scope, expr, LOOK_want::NORMAL, false);\n> > if (TREE_CODE (TREE_CODE (expr) == TEMPLATE_DECL\n> > -\t\t ? DECL_TEMPLATE_RESULT (expr) : expr) == TYPE_DECL)\n> > +\t\t ? DECL_TEMPLATE_RESULT (expr) : expr) == TYPE_DECL\n> > +\t /* For ^^T::X, we'll take both types and non-types. */\n> > +\t && !reflecting_p)\n> > \t{\n> > \t if (complain & tf_error)\n> > \t {\n> > @@ -23355,7 +23359,8 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl)\n> > \telse if (TREE_CODE (h) == SCOPE_REF)\n> > \t h = tsubst_qualified_id (h, args, complain, in_decl,\n> > \t\t\t\t /*done=*/true, /*address_p=*/false,\n> > -\t\t\t\t /*name_lookup_p=*/false);\n> > +\t\t\t\t /*name_lookup_p=*/false,\n> > +\t\t\t\t /*reflecting_p=*/true);\n> \n> Should we just merge name_lookup_p with reflecting_p at this point?\n> More descriptive flag names are nice but having fewer flags is also nice :)\n> And at first glance name_lookup_p doesn't seem precisely named, there\n> are name lookup calls in tsubst_qualified_id that aren't suppressed by\n> that flag (such as the ones immediately before the error in question).\n\nYeah, that's a good point. name_lookup_p was false only when called from\ntsubst_expr/REFLECT_EXPR anyway. So I think we should indeed merge them\nas you suggest.\n\ndg.exp passed so far, ok for 17?\n\n-- >8 --\nHere we issue a bogus error for\n\n ^^Cls<T>::template Inner\n\nwhere Inner turns out to be a class type, but we created a SCOPE_REF\nbecause we can't know in advance what it will substitute into, and\n\n ^^typename Cls<T>::template Inner\n\nis invalid. The typename can only be used in\n\n ^^typename Cls<T>::template Inner<int>\n\nWe're taking a reflection so both types and non-types are valid, so\nI think we shouldn't give the error for ^^, and take the reflection\nof the TEMPLATE_DECL.\n\n\tPR c++/124926\n\ngcc/cp/ChangeLog:\n\n\t* pt.cc (tsubst_qualified_id): Rename name_lookup_p parameter to\n\treflecting_p. Check !reflecting_p instead of name_lookup_p. Do\n\tnot give the \"instantiation yields a type\" error when reflecting_p\n\tis true.\n\t(tsubst_expr) <case REFLECT_EXPR>: Adjust the call to\n\ttsubst_qualified_id.\n\ngcc/testsuite/ChangeLog:\n\n\t* g++.dg/reflect/dep15.C: New test.\n---\n gcc/cp/pt.cc | 12 ++--\n gcc/testsuite/g++.dg/reflect/dep15.C | 85 ++++++++++++++++++++++++++++\n 2 files changed, 92 insertions(+), 5 deletions(-)\n create mode 100644 gcc/testsuite/g++.dg/reflect/dep15.C\n\n\nbase-commit: 6bf53f242bc7783894bf3148a2829d626a8a1602", "diff": "diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc\nindex 5d97ca7997f..551c8bcbb68 100644\n--- a/gcc/cp/pt.cc\n+++ b/gcc/cp/pt.cc\n@@ -18238,12 +18238,12 @@ tsubst_baselink (tree baselink, tree object_type,\n true if the qualified-id will be a postfix-expression in-and-of\n itself; false if more of the postfix-expression follows the\n QUALIFIED_ID. ADDRESS_P is true if the qualified-id is the operand\n- of \"&\". NAME_LOOKUP_P is true if we intend to perform name lookup. */\n+ of \"&\". REFLECTING_P is true if this SCOPE_REF is an operand of ^^. */\n \n static tree\n tsubst_qualified_id (tree qualified_id, tree args,\n \t\t tsubst_flags_t complain, tree in_decl,\n-\t\t bool done, bool address_p, bool name_lookup_p = true)\n+\t\t bool done, bool address_p, bool reflecting_p = false)\n {\n tree expr;\n tree scope;\n@@ -18322,7 +18322,9 @@ tsubst_qualified_id (tree qualified_id, tree args,\n else\n \texpr = lookup_qualified_name (scope, expr, LOOK_want::NORMAL, false);\n if (TREE_CODE (TREE_CODE (expr) == TEMPLATE_DECL\n-\t\t ? DECL_TEMPLATE_RESULT (expr) : expr) == TYPE_DECL)\n+\t\t ? DECL_TEMPLATE_RESULT (expr) : expr) == TYPE_DECL\n+\t /* For ^^T::X, we'll take both types and non-types. */\n+\t && !reflecting_p)\n \t{\n \t if (complain & tf_error)\n \t {\n@@ -18368,7 +18370,7 @@ tsubst_qualified_id (tree qualified_id, tree args,\n \t\t\t\t expr, input_location);\n /* For ^^S::mem, we do not want to create the dummy object that\n finish_non_static_data_member would give us. */\n- else if (TYPE_P (scope) && name_lookup_p)\n+ else if (TYPE_P (scope) && !reflecting_p)\n {\n expr = (adjust_result_of_qualified_name_lookup\n \t (expr, scope, current_nonlambda_class_type ()));\n@@ -23355,7 +23357,7 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl)\n \telse if (TREE_CODE (h) == SCOPE_REF)\n \t h = tsubst_qualified_id (h, args, complain, in_decl,\n \t\t\t\t /*done=*/true, /*address_p=*/false,\n-\t\t\t\t /*name_lookup_p=*/false);\n+\t\t\t\t /*reflecting_p=*/true);\n \telse\n \t {\n \t /* [expr.reflect] The id-expression of a reflect-expression is\ndiff --git a/gcc/testsuite/g++.dg/reflect/dep15.C b/gcc/testsuite/g++.dg/reflect/dep15.C\nnew file mode 100644\nindex 00000000000..40273955164\n--- /dev/null\n+++ b/gcc/testsuite/g++.dg/reflect/dep15.C\n@@ -0,0 +1,85 @@\n+// PR c++/124926\n+// { dg-do compile { target c++26 } }\n+// { dg-additional-options \"-freflection\" }\n+\n+template <typename T, typename U>\n+constexpr bool is_same_v = false;\n+\n+template <typename T>\n+constexpr bool is_same_v<T, T> = true;\n+\n+// Class template\n+template <typename>\n+struct C1 {\n+ template <typename> struct Inner {};\n+};\n+\n+template <typename T>\n+constexpr auto vt1 = ^^C1<T>::template Inner;\n+constexpr auto r1 = vt1<int>;\n+typename [:r1:]<int> a;\n+static_assert(r1 == ^^C1<int>::template Inner);\n+static_assert(is_same_v<decltype(a), C1<int>::Inner<int>>);\n+\n+// Class template with typename\n+template <typename>\n+struct C6 {\n+ template <typename> struct Inner {};\n+};\n+\n+template <typename T>\n+constexpr auto vt6 = ^^typename C6<T>::template Inner<T>;\n+constexpr auto r6 = vt6<int>;\n+typename [:r6:] d;\n+static_assert(r6 == ^^C6<int>::template Inner<int>);\n+static_assert(is_same_v<decltype(d), C6<int>::Inner<int>>);\n+\n+// Variable template\n+template <typename>\n+struct C2 {\n+ template <typename> static constexpr int Inner = 42;\n+};\n+\n+template <typename T>\n+constexpr auto vt2 = ^^C2<T>::template Inner;\n+constexpr auto r2 = vt2<int>;\n+constexpr int i = template [:r2:]<int>;\n+static_assert(i == 42);\n+static_assert(vt2<int> == ^^C2<int>::template Inner);\n+\n+// Function template\n+template <typename>\n+struct C3 {\n+ template <typename T> static constexpr int Inner (T t) { return t; };\n+};\n+template <typename T>\n+constexpr auto vt3 = ^^C3<T>::template Inner;\n+constexpr auto r3 = vt3<int>;\n+static_assert(template [:r3:](42) == 42);\n+static_assert(vt3<int> == ^^C3<int>::template Inner);\n+\n+// Alias template\n+template <typename>\n+struct C4 {\n+ template <typename T> using Inner = C4<T>;\n+};\n+template <typename T>\n+constexpr auto vt4 = ^^C4<T>::template Inner;\n+constexpr auto r4 = vt4<int>;\n+typename [:r4:]<int> b;\n+static_assert(is_same_v<decltype(b), C4<int>>);\n+static_assert(vt4<int> == ^^C4<int>::template Inner);\n+\n+// Alias template with typename\n+template<typename T> struct X { };\n+\n+template <typename>\n+struct C5 {\n+ template <typename T> using Inner = X<T>;\n+};\n+template <typename T>\n+constexpr auto vt5 = ^^typename C5<T>::template Inner<T>;\n+constexpr auto r5 = vt5<int>;\n+typename [:r5:] c;\n+static_assert(is_same_v<decltype(c), X<int>>);\n+static_assert(vt5<int> == ^^C5<int>::template Inner<int>);\n", "prefixes": [ "v2" ] }