This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
libstdc++/7986: Problems with demangling (__cxa_demangle())
- From: johnb at stl dot sarov dot ru
- To: gcc-gnats at gcc dot gnu dot org
- Date: 20 Sep 2002 11:45:44 -0000
- Subject: libstdc++/7986: Problems with demangling (__cxa_demangle())
- Reply-to: johnb at stl dot sarov dot ru
>Number: 7986
>Category: libstdc++
>Synopsis: Problems with demangling (__cxa_demangle())
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Sep 20 04:46:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: johnb@stl.sarov.ru
>Release: gcc 3.2, gcc 3.1
>Organization:
>Environment:
Red Hat Linux 8.0beta
>Description:
I used a simple program which calls __cxa_demangle function. These mangled names were demangled wrong:
_Z1fA37_iPS_ -> f(int[37], int[37]*), should be: f(int[37], int (*) [37])
_Z1fM1AFivEPS0_ -> f(int (A::*)(), int ()()*), should be: f(int (A::*)(), int (*)())
_Z1fPFPA1_ivE -> f(int (*) [1] (*)()), should be: f(int (*(*)()) [1])
_Z1fPKM1AFivE -> f(int (A::*)() const*), should be: f(int (A::* const*)())
_Z1jM1AFivEPS1_ -> j(int (A::*)(), int (A::*)()*), should be: j(int (A::*)(), int (A::**)())
_Z1sPA37_iPS0_ -> s(int (*) [37], int (*) [37]*), should be: s(int (*) [37], int (**) [37])
_Z3fooA30_A_i -> foo(int[][30]), should be: foo(int[30][])
_Z3kooPA28_A30_i -> koo(int[30] (*) [28]), should be: koo(int (*) [28][30])
_ZlsRKU3fooU4bart1XS0_ -> operator<<(foo bart X const&, bart X), should be: operator<<(X const foo bart&, X const foo bart)
And in these cases __cxa_demangle() returned -2 (Invalid mangled name):
_Z1fM1AKFivE -> _Z1fM1AKFivE, should be: f(int (A::*)() const)
_Z3absILd1c1f1496f8a44219EEvv -> _Z3absILd1c1f1496f8a44219EEvv, should be: void abs<3.14159e-173>()
_Z3absILd40092acd9e83e426EEvv -> _Z3absILd40092acd9e83e426EEvv, should be: void abs<3.1459>()
_Z3absILe08042191a6cc56a2fe117becEEvv -> _Z3absILe08042191a6cc56a2fe117becEEvv, should be: void abs<1.234e-2345l>()
_Z3absILe804bfff8000000000000000EEvv -> _Z3absILe804bfff8000000000000000EEvv, should be: void abs<-1l>()
_Z3absILf4016147bEEvv -> _Z3absILf4016147bEEvv, should be: void abs<2.345f>()
_Z3absILfc1800000EEvv -> _Z3absILfc1800000EEvv, should be: void abs<-16f>()
>How-To-Repeat:
Feed those mangled names to __cxa_demangle() function and check the results of demangling.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: