You may also use c++filt with option -t (type) to demangle the type name:
#include
#include
#include
using namespace std;
int main() {
auto x = 1;
string my_type = typeid(x).name();
system(("echo " + my_type + " | c++filt -t").c_str());
return 0;
}
Tested on linux only.