Bug 15576 – extern(C++, namespace) wrong mangling of variables (Windows)

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-01-18T05:36:00Z
Last change time
2017-01-16T23:24:24Z
Keywords
bootcamp, C++
Assigned to
nobody
Creator
turkeyman

Comments

Comment #0 by turkeyman — 2016-01-18T05:36:42Z
C++: namespace ep { struct Instance {}; Instance *s_pInstance = nullptr; } D: extern (C++, ep) { struct Instance {} extern __gshared Instance* s_pInstance; } C++ mangles: ?s_pInstance@ep@@3PEAUInstance@1@EA D mangles: ?s_pInstance@ep@@2PEAUInstance@1@EA Notice there is a '2' where a '3' should be.
Comment #1 by jbc.engelen — 2016-11-02T13:40:01Z
I ran into the same problem. Simpler reproducer: D: extern (C++, ep) extern __gshared int variable; C++: namespace ep { int variable; }
Comment #2 by jbc.engelen — 2016-11-02T14:00:20Z
Bootcamp hint: start looking at `mangleVariable` in `VisualCPPMangler` in cppmangle.d.
Comment #3 by bugzilla — 2016-11-03T03:22:43Z
Comment #4 by github-bugzilla — 2016-11-06T09:15:23Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/b725551c35874fdce085a1475f6bd0db398e0f64 Fix issue 15576 - Skip over the parent expression when parent is NSpace. https://github.com/dlang/dmd/commit/dcb58fc97636d9fbe1ee3405be1152c966f456dd Merge pull request #6232 from LemonBoy/cppmangle Fix issue 15576 - Skip over the parent expression when parent is NSpace.
Comment #5 by github-bugzilla — 2016-12-27T14:40:52Z
Commits pushed to scope at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/b725551c35874fdce085a1475f6bd0db398e0f64 Fix issue 15576 - Skip over the parent expression when parent is NSpace. https://github.com/dlang/dmd/commit/dcb58fc97636d9fbe1ee3405be1152c966f456dd Merge pull request #6232 from LemonBoy/cppmangle
Comment #6 by github-bugzilla — 2017-01-16T23:24:24Z
Commits pushed to newCTFE at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/b725551c35874fdce085a1475f6bd0db398e0f64 Fix issue 15576 - Skip over the parent expression when parent is NSpace. https://github.com/dlang/dmd/commit/dcb58fc97636d9fbe1ee3405be1152c966f456dd Merge pull request #6232 from LemonBoy/cppmangle