public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: centurion <centurion009@proton.me>, Patrick Palka <ppalka@redhat.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] c++: fix alias CTAD [PR114377]
Date: Thu, 4 Apr 2024 17:21:55 -0400	[thread overview]
Message-ID: <c8f95277-886a-47fc-9ff8-389e065268e0@redhat.com> (raw)
In-Reply-To: <ONxKaLpXKwQW1hMiCCVdyHUYMbS8mY3hC3GQUpIf4YfTUkHrqtoaicZmc1cVmMfktmtle_p0dZRlOG61riUPzKvVqWF7AO12SOA8rSAABTU=@proton.me>

Applied, thanks!

BTW, in future please see

   https://gcc.gnu.org/contribute.html#legal

This patch is small enough to not need to worry about copyright, but for 
larger patches we would.

On 3/27/24 14:36, centurion wrote:
> 
> 	PR c++/114377
> 
> gcc/cp/ChangeLog:
> 
> 	PR c++/114377
> 	* pt.cc (find_template_parameter_info::found): Use TREE_TYPE for
> 	TEMPLATE_DECL instead of DECL_INITIAL.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* g++.dg/cpp2a/class-deduction-alias19.C: New test.
> ---
>   gcc/cp/pt.cc                                      |  3 ++-
>   .../g++.dg/cpp2a/class-deduction-alias19.C        | 15 +++++++++++++++
>   2 files changed, 17 insertions(+), 1 deletion(-)
>   create mode 100644 gcc/testsuite/g++.dg/cpp2a/class-deduction-alias19.C
> 
> diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
> index 7b00a8615d2..1425d6116d0 100644
> --- a/gcc/cp/pt.cc
> +++ b/gcc/cp/pt.cc
> @@ -11032,7 +11032,8 @@ find_template_parameter_info::found (tree parm)
>   {
>     if (TREE_CODE (parm) == TREE_LIST)
>       parm = TREE_VALUE (parm);
> -  if (TREE_CODE (parm) == TYPE_DECL)
> +  if (TREE_CODE (parm) == TYPE_DECL
> +      || TREE_CODE (parm) == TEMPLATE_DECL)
>       parm = TREE_TYPE (parm);
>     else
>       parm = DECL_INITIAL (parm);
> diff --git a/gcc/testsuite/g++.dg/cpp2a/class-deduction-alias19.C b/gcc/testsuite/g++.dg/cpp2a/class-deduction-alias19.C
> new file mode 100644
> index 00000000000..1ea79bd7691
> --- /dev/null
> +++ b/gcc/testsuite/g++.dg/cpp2a/class-deduction-alias19.C
> @@ -0,0 +1,15 @@
> +// PR c++/114377
> +// { dg-do compile { target c++20 } }
> +
> +template <template <typename> typename Iterator>
> +struct K {};
> +
> +template <typename C, typename IteratorPolicy>
> +class Foo {};
> +
> +template <typename C, template<typename> typename TTP>
> +using Bar = Foo<C, K<TTP>>;
> +
> +void s() {
> +    Bar(1); // { dg-error "failed|no match" }
> +}


      reply	other threads:[~2024-04-04 21:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25 15:17 centurion
2024-03-26 10:04 ` centurion
2024-03-26 10:05 ` centurion
2024-03-27 14:21 ` Patrick Palka
2024-03-27 18:36   ` centurion
2024-04-04 21:21     ` Jason Merrill [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c8f95277-886a-47fc-9ff8-389e065268e0@redhat.com \
    --to=jason@redhat.com \
    --cc=centurion009@proton.me \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ppalka@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).