[cfe-dev] How to demangle _ZN3foocvPT_I3barEEv?

Richard Smith richard at metafoo.co.uk
Mon Feb 11 11:02:10 PST 2013


On Mon, Feb 11, 2013 at 7:05 AM, Marshall Clow <mclow.lists at gmail.com>wrote:

> On Monday 11 February 2013 14:06:45 fakju666 wrote:
> > Can anyone tell me what this is supposed to demangle to:
> >
> > _ZN3foocvPT_I3barEEv
> >
> > I got this in a call graph generated by opt, and this is the only name
> that
> > c++filt can't process. I think the problem is with the "T_" identifier,
> > because c++filt is happy if I replace it with "S_":
> >
> > foo::operator foo<bar>*()
>
> $ c++filt -n _ZN3foocvPT_I3barEEv
> foo::operator bar*<bar>()


This is the right answer (or, prior to substitution, template<typename T>
foo::operator T*(), with T = bar).

This case is a little hard to demangle, since it's /almost/ ambiguous. It
could be conversion to PT_ (that is, "operator template-type-parameter-0
*"), instantiated with <bar>, or it could be conversion to PT_I3barE (that
is, "operator template-template-parameter-0<bar> *"). But it actually can't
be the latter, since the use of the template-template-parameter implies
that we need to specify template arguments, so we'd expect another template
argument list: _ZN3foocvPT_I3barEI3bazEEv.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130211/1ef3027d/attachment.html>


More information about the cfe-dev mailing list