From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26608 invoked by alias); 25 Feb 2003 15:06:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 26585 invoked by uid 71); 25 Feb 2003 15:06:00 -0000 Date: Tue, 25 Feb 2003 15:06:00 -0000 Message-ID: <20030225150600.26584.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Carlo Wood Subject: Re: c++/8897: Demangling of template conversion operators Reply-To: Carlo Wood X-SW-Source: 2003-02/txt/msg01327.txt.bz2 List-Id: The following reply was made to PR c++/8897; it has been noted by GNATS. From: Carlo Wood To: Benjamin Kosnik 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::operator float(void)"); > // XXX better "A::operator int()" > // XXX better "A::operator T()[T=int]" > } > > I'm not quite sure what's up with this one. It's template struct A { template operator T2(); }; A a; (int)a; <-- that function. The demangling is obvious a bug. A first "fix" would be to print: A::operator int() compare A::templatememberfunction() or say, A::operator +=(double), being template operator+=(T); But, when the cast type is a class, that could be confusing: A::operator B() Note 'B' cannot be a template, and thus this is NOT ambigious. If B was a template, you'd get: A::operator B >() 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()". -- Carlo Wood