This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
how do I demangle the name from typeinfo(obj).name()?
- To: gcc at gcc dot gnu dot org, gcc-help at gcc dot gnu dot org
- Subject: how do I demangle the name from typeinfo(obj).name()?
- From: David Baraff <deb at pixar dot com>
- Date: Fri, 13 Oct 2000 13:23:55 -0700
[Apologies for cross-post; couldn't decide which one was really
correct.]
I'm trying to demangle names that come back from typeinfo, e.g.
cout << typeinfo(someObject).name() << "\n";
Some of the things I get out are successfully demangled using the
c++filt program (with
option -edg) but some simple things are not!! I add the required "__"
(two underscores)
but that doesn't always work.
Here are some outputs:
6foobar /* demangles after adding __ */
t4list2Z6foobarZt15TaggedAllocator1Z6foobar /* demangles after
adding __ */
i /* doesn't demangle no matter what */
Fv_i /* doesn't demangle no matter what */
Sadly, the last two cases are, respectively, printing the signatures
of an int, and main.
Could someone PLEASE tell me how to consistently demangle these names?