www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14579] New: [SPEC] No specification on modifiers in

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 puremagic.com
          Reporter: ibuclaw 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.

--
May 12 2015