Thread overview
[Issue 5956] New: Undocumented mangling of struct value
May 08, 2011
kennytm@gmail.com
Jun 19, 2011
kennytm@gmail.com
Jul 19, 2011
kennytm@gmail.com
Jan 21, 2012
Walter Bright
May 08, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5956

           Summary: Undocumented mangling of struct value
           Product: D
           Version: D2
          Platform: All
               URL: http://d-programming-language.org/abi.html
        OS/Version: All
            Status: NEW
          Keywords: spec
          Severity: normal
          Priority: P2
         Component: websites
        AssignedTo: nobody@puremagic.com
        ReportedBy: kennytm@gmail.com


--- Comment #0 from kennytm@gmail.com 2011-05-08 07:38:22 PDT ---
Consider the program:

----------------------------------------
module y;
template fffff(alias s) {
    void fffff() {
    }
}
struct U {
    int v;
}
void main() {
    fffff!( U(4) )();
}
----------------------------------------

The mangled symbol of fffff!( U(4) ) is:

    _D1y20__T5fffffVS1y1US1i4Z5fffffFZv

which means

    _D          (MangledName)
      1y        (LName: y)
      20__T     (TemplateInstanceName)
        5fffff  (LName: fffff)
        V       (TemplateArg: value)
         S      (TypeStruct)
          1y    (LName: y)
          1U    (LName: U)
         S1     (***UNDOCUMENTED*** struct value with 1 argument)
           i4   (integer: 4)
        Z       (end of TemplateInstanceName)
      5fffff    (LName: fffff)
      FZv       (TypeFunction: void _())

Above, the mangling

Value:
     'S' Number Value...

is not documented at all. The D spec should mention it.

(Also, the spec should also mention 'A Number Value...' can represent associative array literal as well.)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 19, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5956



--- Comment #1 from kennytm@gmail.com 2011-06-19 12:39:27 PDT ---
Demangling for struct literals have been implemented in commit 434e, and that of associative array literal in commit cbc4.

https://github.com/D-Programming-Language/druntime/commit/434e2d301fa5bfac111606e920a390e5e4715378 https://github.com/D-Programming-Language/druntime/commit/cbc43e78df87cdf01069f383458d611a585c3e54

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 19, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5956



--- Comment #2 from kennytm@gmail.com 2011-07-19 02:09:49 PDT ---
Doc fix:

https://github.com/D-Programming-Language/d-programming-language.org/pull/17

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 21, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5956


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------