[Issue 11131] New: variables without linkage shouldn't have a mangling (.mangleof)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Sep 27 11:23:52 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=11131

           Summary: variables without linkage shouldn't have a mangling
                    (.mangleof)
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: code at dawg.eu


--- Comment #0 from Martin Nowak <code at dawg.eu> 2013-09-27 11:23:50 PDT ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list