Bug 14579 – [SPEC] No specification on modifiers in TypeDelegate symbols

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-05-12T11:51:00Z
Last change time
2015-10-04T18:21:48Z
Keywords
pull, spec
Assigned to
nobody
Creator
ibuclaw

Comments

Comment #0 by ibuclaw — 2015-05-12T11:51:42Z
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.
Comment #1 by ibuclaw — 2015-05-12T12:34:10Z
Code example on how to trigger it: --- module demangle; void spawn(F, T...)( F fn, T args ) { _spawn( false, fn, args ); } private void _spawn(F, T...)( bool linked, F fn, T args ) { } void main() { void delegate(int) immutable dg5; spawn(dg5, 5); } --- Mangles as: _D8demangle20__T6_spawnTDyFiZvTiZ6_spawnFNaNbNiNfbDyFiZviZv Note the 'DyF' On some second thought, perhaps this should be added to the TypeDelegate mangle instead, as TypeModifiers can not really be applied to function types. TypeDelegate: D TypeFunction Change this to: TypeDelegate: D TypeModifiers TypeFunction
Comment #2 by k.hara.pg — 2015-05-17T13:57:42Z
Comment #3 by github-bugzilla — 2015-07-07T20:08:37Z
Commits pushed to master at https://github.com/D-Programming-Language/dlang.org https://github.com/D-Programming-Language/dlang.org/commit/5cf9d84051e3e6537392985a5bddeef8d804dc62 fix Issue 14579 - [SPEC] No specification on modifiers in TypeDelegate symbols https://github.com/D-Programming-Language/dlang.org/commit/0995b3119457a6ac410d2cd8c45f9317fd4201a7 Merge pull request #996 from 9rnsr/fix14579 Issue 14579 - [SPEC] No specification on modifiers in TypeDelegate symbols
Comment #4 by github-bugzilla — 2015-10-04T18:21:48Z