How to demangle _ZN3foocvPT_I3barEEv?

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>*()

Could it be something like:

template<template<typename S> class T>
foo<T>::operator T<bar>*()

"T_" seems to indicate a template dependent name.
I don't know where you got that symbol from.

$ c++filt -n _ZN3foocvPT_I3barEEv
foo::operator bar*<bar>()

"-n" means "don't strip leading underscore"

-- Marshall

Marshall Clow Idio Software <mailto:mclow.lists@gmail.com>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki

Just a guess, but usually, C++ symbols start with a double '_'.

c++filt __ZN3foocvPT_I3barEEv

foo::operator bar*<bar>()

-- Jean-Daniel

Just a guess, but usually, C++ symbols start with a double '_'.

That depends on the host platform. OSX puts an underscore before every
symbol, Linux doesn't (and Windows does something completely different
for C++).

Incidentally, my c++filt doesn't reproduce Marshall's findings either:

$ c++filt -n _ZN3foocvPT_I3barEEv
_ZN3foocvPT_I3barEEv

I couldn't make it fit anywhere in the specification either, but I'm
not an expert there.

Cheers.

Tim.

Marshall Clow wrote:

$ c++filt -n _ZN3foocvPT_I3barEEv
foo::operator bar*<bar>()

"-n" means "don't strip leading underscore"

Which version of c++filt do you use? I've got GNU c++filt (GNU Binutils for Ubuntu) 2.22 and can't reproduce this here. Also, according to "c++filt -h" -n is enabled by default.

name@name:~$ c++filt -n _ZN3foocvPT_I3barEEv
_ZN3foocvPT_I3barEEv

Olivier Goffart wrote:

This is the right answer (or, prior to substitution, template 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 , or it could be conversion to PT_I3barE (that is, “operator template-template-parameter-0 *”). 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.