[Issue 14579] New: [SPEC] No specification on modifiers in TypeFunction symbols

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue May 12 04:51:42 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14579

          Issue ID: 14579
           Summary: [SPEC] No specification on modifiers in TypeFunction
                    symbols
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: ibuclaw at gdcproject.org

Current spec on TypeFunction

TypeFunction:
    CallConvention FuncAttrs Parameters ParamClose Type

CallConvention:
    F       // D
    U       // C
    W       // Windows
    V       // Pascal
    R       // C++

...

There is a discrepancy in that CallConvention may optionally be prefixed by any
type modifiers.

See here:
https://github.com/D-Programming-Language/dmd/blob/acbe13ee54e024c0bba044d1146e244a5ea57502/src/mangle.c#L219


Specification should be updated to:

TypeFunction:
    TypeModifiers(opt) CallConvention FuncAttrs Parameters ParamClose Type

TypeModifiers:
    TypeModifier
    TypeModifier TypeModifiers

TypeModifier:
    O    // shared
    Ng   // inout
    x    // const
    y    // immutable


However current valid combinations in are here:
https://github.com/D-Programming-Language/dmd/blob/acbe13ee54e024c0bba044d1146e244a5ea57502/src/mangle.c#L100

And I make these assumptions in libiberty's D demangler.

--


More information about the Digitalmars-d-bugs mailing list