Why does typeid.name() return weird characters using GCC and how to make it print unmangled names?

The return of name is implementation defined : an implementation is not even required to return different strings for different types.

What you get from g++ is a decorated name, that you can “demangle” using the c++filt command or __cxa_demangle.

Leave a Comment