Bug 16525 – C++ member variables have no mangling

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2016-09-22T12:00:00Z
Last change time
2016-11-04T09:05:09Z
Keywords
ice
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2016-09-22T12:00:58Z
cat > bug.d << CODE static immutable templ(alias var) = 1234; struct D { int memvar; } extern(C++) struct CPP { int memvar; } void test() { pragma(msg, templ!(D.memvar)); pragma(msg, templ!(CPP.memvar)); pragma(msg, CPP.memvar.mangleof); // root cause } CODE dmd -c bug ---- bug.d(10): Error: variable bug.CPP.memvar Internal Compiler Error: C++ static non- __gshared non-extern variables not supported ---- Not sure if C++ defines a member variable mangling, but we need it at a couple of places and it's blocking issue 16513.
Comment #1 by github-bugzilla — 2016-09-25T04:54:09Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/376b34d10968c0ea0169fe1c6876b7b3227dea0e fix Issue 16525 - C++ member variables have no mangling - while there seems to be no way to require mangling of C++ member variables in C++ itself, D does need the mangling for template parameters - use the same mangling as for static member variables https://github.com/dlang/dmd/commit/89e098f1bb7946166757ab3f0d03737a0b5c5ef9 Merge pull request #6147 from MartinNowak/fix16525 fix Issue 16525 - C++ member variables have no mangling
Comment #2 by github-bugzilla — 2016-10-01T11:48:46Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/376b34d10968c0ea0169fe1c6876b7b3227dea0e fix Issue 16525 - C++ member variables have no mangling https://github.com/dlang/dmd/commit/89e098f1bb7946166757ab3f0d03737a0b5c5ef9 Merge pull request #6147 from MartinNowak/fix16525
Comment #3 by github-bugzilla — 2016-11-04T09:05:09Z
Commits pushed to newCTFE at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/376b34d10968c0ea0169fe1c6876b7b3227dea0e fix Issue 16525 - C++ member variables have no mangling https://github.com/dlang/dmd/commit/89e098f1bb7946166757ab3f0d03737a0b5c5ef9 Merge pull request #6147 from MartinNowak/fix16525