public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Cary Coutant <ccoutant@google.com>, Jason Merrill <jason@redhat.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 2/3] PR other/61321 - demangler crash on casts in template parameters
Date: Fri, 25 Jul 2014 09:55:00 -0000	[thread overview]
Message-ID: <53D22072.4000200@redhat.com> (raw)
In-Reply-To: <CAHACq4oTMguPzkYC20-WUt4JitTnVz2DnSnW1c-B9Jase0Yb8A@mail.gmail.com>

On 07/24/2014 11:35 PM, Cary Coutant wrote:
>> 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?
> 
> I think conversion ops really are a special case. 

Thanks Cary.  FWIW, I agree.

(GDB 7.8 hasn't been released yet, though it's close.  If this
patch is approved as is, we'll be able to have the crash
fixed there.  If this requires a significant rewrite though,
I'm afraid I might not be able to do it myself anytime soon.)

> It's the only case
> where the template parameters refer to the template argument list from
> the cast operator's enclosing template. In a cast expression, like
> anywhere else you might have a template parameter, the template
> parameter refers to the template argument list of the immediately
> enclosing template.
> 
> I think this note from Section 5.1.3 (Operator Encodings) of the ABI
> is what makes this a special case (it's an informative comment in the
> document, but seems to me to be normative):
> 
> "For a user-defined conversion operator the result type (i.e., the
> type to which the operator converts) is part of the mangled name of
> the function. If the conversion operator is a member template, the
> result type will appear before the template parameters. There may be
> forward references in the result type to the template parameters."
> 

-- 
Thanks,
Pedro Alves

  reply	other threads:[~2014-07-25  9:16 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 3/3] " 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
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
2014-07-24 22:44     ` Cary Coutant
2014-07-25  9:55       ` Pedro Alves [this message]
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

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=53D22072.4000200@redhat.com \
    --to=palves@redhat.com \
    --cc=ccoutant@google.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@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).