This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/13447] Another demangler problem with method cv-qualifiers


------- Additional Comments From ian at wasabisystems dot com  2003-12-19 18:41 -------
Subject: Re:  New: Another demangler problem with method cv-qualifiers

Daniel Jacobowitz <drow@mvista.com> writes:

> On Fri, Dec 19, 2003 at 01:28:30PM -0500, Ian Lance Taylor wrote:
> > The mangled name is _ZNK1C1fIiEEPFivEv, which currently demangles as
> > 
> > int (*C::f<int>() const)()
> > 
> > That more or less corresponds to the declaration.  However, I don't
> > know whether this is correct C++.
> 
> I believe it's correct C++.  At least, it exercises the bits of my
> parser most closely based on the standard, and I parse it exactly as
> above.  The CONST_THIS gets attached to the function_arglist used for
> the method itself, not the return type.

What would it mean to attach to CONST_THIS to the return type?

Specifically, this example does not compile:

class C { public: template<typename i> int (*f())() const; };
int foo(const C c) { return (*c.f<int>())(); }

but this one does:

class C { public: template<typename i> int (*f())() const; };
int foo(C c) { return (*c.f<int>())(); }

The only change is that foo's argument is not const.

The mangled name is _ZN1C1fIiEEPFivEv which demangles to
    int (*C::f<int>())()

What is the meaning of that trailing const on the first line?  What
does it mean to apply a trailing const to a return type?

Ian


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13447


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]