[Issue 14591] [SPEC] Ambiguity between extern(Pascal) and template value parameters

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Apr 12 00:31:12 PDT 2017


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

Iain Buclaw <ibuclaw at gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |ibuclaw at gdcproject.org

--- Comment #2 from Iain Buclaw <ibuclaw at gdcproject.org> ---
I think this has been fixed by clarifying the spec in dlang.org/#1511:

https://github.com/dlang/dlang.org/commit/6230e592c983ae742ac5ebae8db060748eb08fb8#diff-7bd92f948c3c1d8d0d16a465bb464b99L241

There's ambiguity without this distinction in the grammar.

Furthermore, if that wasn't enough, dlang.org/#1626 puts any further ambiguity
to rest.

https://github.com/dlang/dlang.org/pull/1626


The binutils D demangler was implemented according to the current spec of the
time 2/3 years ago, and so does the following:

---
if (ISDIGIT (*mangled))
  mangled = dlang_parse_symbol (decl, mangled);
else if (strncmp (mangled, "_D", 2) == 0)
  {
    mangled += 2;
    mangled = dlang_parse_symbol (decl, mangled);
  }
---

With the updated spec now in, I think the corrective action on my side is to
separate the handling of MangleName, QualifiedName, and SymbolName into
different functions, so that the above becomes:

---
if (ISDIGIT (*mangled))
  mangled = dlang_parse_symbol (decl, mangled);
else if (strncmp (mangled, "_D", 2) == 0)
  mangled = dlang_parse_mangle (decl, mangled);
---

--


More information about the Digitalmars-d-bugs mailing list