public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Pedro Alves <palves@redhat.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 2/3] PR other/61321 - demangler crash on casts in template parameters
Date: Mon, 02 Jun 2014 13:42:00 -0000	[thread overview]
Message-ID: <538C7F4F.4050800@redhat.com> (raw)
In-Reply-To: <1401191856-27585-3-git-send-email-palves@redhat.com>

On 05/27/2014 07:57 AM, Pedro Alves wrote:
> And after the fix for 59195, due to:
>
>   static void
>   d_print_cast (struct d_print_info *dpi, int options,
> 	       const struct demangle_component *dc)
>   {
>   ...
>     /* For a cast operator, we need the template parameters from
>        the enclosing template in scope for processing the type.  */
>     if (dpi->current_template != NULL)
>       {
>         dpt.next = dpi->templates;
>         dpi->templates = &dpt;
>         dpt.template_decl = dpi->current_template;
>       }
>
> when printing the template argument list of A (what should be "<sizeof
> (int)>"), the template parameter 0 (that is, "T_", the '**' above) now
> refers to the first parameter of the the template argument list of the
> 'A' template (the '*' above), exactly what we were already trying to
> print.  This leads to infinite recursion, and stack exaustion.  The
> template parameter 0 should actually refer to the first parameter of
> the 'function_temp' template.

It seems that the problem here is more general; a template argument list 
is not in scope within that same template argument list.  Can't we fix 
that without special-casing conversion ops?

Jason

  parent reply	other threads:[~2014-06-02 13:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-27 11:57 [PATCH 0/3] mangler/demangler dogfooding Pedro Alves
2014-05-27 11:57 ` [PATCH 2/3] PR other/61321 - demangler crash on casts in template parameters Pedro Alves
2014-05-30 17:37   ` Cary Coutant
2014-05-30 18:05     ` Ian Lance Taylor
2014-05-30 19:00       ` Pedro Alves
2014-06-02 13:42   ` Jason Merrill [this message]
2014-07-24 22:44     ` Cary Coutant
2014-07-25  9:55       ` Pedro Alves
2014-10-13 18:46         ` Cary Coutant
2014-11-10 21:45           ` Cary Coutant
2014-11-12 15:16             ` Jason Merrill
2014-05-27 11:57 ` [PATCH 1/3] Fix demangler testsuite crashes with CP_DEMANGLE_DEBUG defined Pedro Alves
2014-05-27 13:56   ` Ian Lance Taylor
2014-05-28 22:20     ` Pedro Alves
2014-05-27 11:57 ` [PATCH 3/3] mangler/demangler dogfooding Pedro Alves
2014-05-27 18:16   ` Mike Stump
2014-05-28 22:31   ` [PATCH v2 " Pedro Alves
2014-06-02 13:38     ` Jason Merrill

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=538C7F4F.4050800@redhat.com \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=palves@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).