"Grizlyk" <[EMAIL PROTECTED]> writes:

> std::unexpected() can print correct name of
> class. What function of g++ does correct name demangling?

__gnu_cxx::__verbose_terminate_handler() in 
gcc-3.4.6/libstdc++-v3/libsupc++/vterminate.cc has this code:

57          type_info *t = __cxa_current_exception_type();
58          if (t)
59            {
60              // Note that "name" is the mangled name.
61              char const *name = t->name();
62              {
63                int status = -1;
64                char *dem = 0;
65                
66                dem = __cxa_demangle(name, 0, 0, &status);
67
68                fputs("terminate called after throwing an instance of '", 
stderr);
69                if (status == 0)
70                  fputs(dem, stderr);
71                else
72                  fputs(name, stderr);
73                fputs("'\n", stderr);
74
75                if (status == 0)
76                  free(dem);
77              }

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to