Bug 11131 – variables without linkage shouldn't have a mangling (.mangleof)

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-09-27T11:23:50Z
Last change time
2024-12-13T18:12:07Z
Keywords
mangling
Assigned to
No Owner
Creator
Martin Nowak
Moved to GitHub: dmd#18683 →

Comments

Comment #0 by code — 2013-09-27T11:23:50Z
cat > bug.d << CODE void foo() { uint var1 = 1; // stack: no linkage => no mangling pragma(msg, var1.mangleof); // prints '_D3bug3fooFZv4var1k' enum uint var2 = 2; // manifest: no linkage => no mangling pragma(msg, var2.mangleof); // prints 'k' // TLS variables are debatable static uint var3 = 3; // TLS: no linkage => no mangling pragma(msg, var3.mangleof); // prints '_D3bug3fooFZv4var3k' (mangling of the initializer) auto var4 = new uint; // heap: no linkage => no mangling pragma(msg, var4.mangleof); // prints '_D3bug3fooFZv4var4Pk' } CODE dmd -c bug ---- The .mangleof property solely looks on the type but doesn't take the storage class into account. Not sure whether these should return an empty string or cause an error.
Comment #1 by ibuclaw — 2017-04-07T21:27:17Z
This is still the case.
Comment #2 by robert.schadek — 2024-12-13T18:12:07Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18683 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB