Summary: std.demangle incorrectly handles template floating
                    point numbers
           Product: D
           Version: D1 & D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos

--- Comment #0 from Jacob Carlborg <> 2010-06-15 11:38:04 PDT ---
According to the ABI spec the mangled form of template floating point numbers
looks like this:

    e HexFloat

    N HexDigits P Exponent
    HexDigits P Exponent

But std.demnalge doesn't seem to handle the exponent, it doesn't handle the
'P'. The unittests that test this are also incorrect. The first one looks like

mangled form:

demangled form:
float test.factorial!(double 4.2, char[5] \"hello\"c, void* null).factorial

As far as I can see the mangled form doesn't follow the spec or what dmd

module test;

float factorial (T...) ()
    return float.init;

void main ()
    factorial!(4.2, "hello", null);

Compiling the above code and running the "nm" command on the resulting binary
shows that "factorial" with the above given values is mangled as:

After all the 6s the is a 7 and then a P. In the std.demangle unittest the P is
missing, also at the end of the mangled name is a Z which is missing in the

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to