public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Carlo Wood <carlo@alinoe.com>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: c++/8897: Demangling of template conversion operators
Date: Tue, 25 Feb 2003 15:06:00 -0000	[thread overview]
Message-ID: <20030225150600.26584.qmail@sources.redhat.com> (raw)

The following reply was made to PR c++/8897; it has been noted by GNATS.

From: Carlo Wood <carlo@alinoe.com>
To: Benjamin Kosnik <bkoz@redhat.com>
Cc: gcc-gnats@gcc.gnu.org, martin@v.loewis.de, gcc-bugs@gcc.gnu.org
Subject: Re: c++/8897: Demangling of template conversion operators
Date: Tue, 25 Feb 2003 16:05:45 +0100

 On Mon, Feb 24, 2003 at 11:45:07PM -0600, Benjamin Kosnik wrote:
 > Did you get a chance to look at:
 > 
 > // c++/8897
 > void test05()
 > {
 >   // cplus-dem FAIL  
 >   // icc FAIL
 >   // new __cxa_demangle FAIL
 >   test("_ZN1AIfEcvT_IiEEv", "A<float>::operator float<int>(void)");
 >   // XXX better "A<float>::operator int()"
 >   // XXX better "A<float>::operator T()[T=int]"
 > }
 > 
 > I'm not quite sure what's up with this one.
 
 It's
 
 template<typename T1>
   struct A {
     template<typename T2>
       operator T2();
   };
 
 A<float> a;
 (int)a;		<-- that function.
 
 The demangling is obvious a bug.  A first "fix" would
 be to print:
 
 A<float>::operator int<int>()
 
 compare
 
 A<float>::templatememberfunction<int>()
 
 or say, A<float>::operator +=<double>(double), being
   template<typename T>
     operator+=(T);
 
 But, when the cast type is a class, that could be
 confusing:
 
 A<float>::operator B<B>()
 
 Note 'B' cannot be a template, and thus this is NOT ambigious.
 If B was a template, you'd get:
 
 A<float>::operator B<int><B<int> >()
 
 for example.
 
 But, the question is: how do you WANT it to look?
 
 I don't like to use "operator T() [with T = int]"
 because it would be the only instance that the demangler
 would use that format.  I think I do prefer the
 "operator int<int>()".
 
 -- 
 Carlo Wood <carlo@alinoe.com>


             reply	other threads:[~2003-02-25 15:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-25 15:06 Carlo Wood [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-02-27  2:07 bkoz
2003-02-25 12:56 Carlo Wood
2002-12-18 11:03 bangerth

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=20030225150600.26584.qmail@sources.redhat.com \
    --to=carlo@alinoe.com \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /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).