This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] c++/78776 fix alias template ICE
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Nathan Sidwell <nathan at acm dot org>
- Cc: Jason Merrill <jason at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 12 Dec 2016 21:10:46 -0800
- Subject: Re: [C++ PATCH] c++/78776 fix alias template ICE
- Authentication-results: sourceware.org; auth=none
- References: <ef9e1f4c-b1e2-24f3-649a-c45d0d51eba3@acm.org>
On Mon, Dec 12, 2016 at 11:12 AM, Nathan Sidwell <nathan@acm.org> wrote:
> This patch fixes an ICE in a checking build where structural_comptypes
> disagrees with TYPE_CANONICAL.
>
> An (implicit) template alias has a different TYPE_TI_TEMPLATE to the thing
> its aliasing. That make structural comparison think it's different. In the
> testcase we end up thinking 'Loc' refers to a different template than
> 'Traits<T>'
>
> Solved by breaking TYPE_TEMPLATE_INFO into an underlying helper that doesn't
> deal with type aliases. While there, I noticed TYPE_TEMPLATE_INFO was doing
> more work than necessary because it checked twice whether DECL_LANG_SPECIFIC
> (TYPE_NAME (NODE)) was non-null. There's no need to check it again in the
> branch we can only get to when it's non-null. I also removed some
> unnecessary parens.
>
> ok?
Note this is originally PR 69481 which I found a year or so ago. I
was trying to debug this and try to understand why typedef and using
would produce different result but I never could figure it out. I
also could not figure out why they went down a different path either
and not treated as the same.
Thanks,
Andrew
>
> nathan
> --
> Nathan Sidwell