[Issue 3031] scoped static var conflicts while linking

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 23 12:40:35 PDT 2010


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


Peter Alexander <peter.alexander.au at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |peter.alexander.au at gmail.co
                   |                            |m
         OS/Version|Windows                     |All


--- Comment #1 from Peter Alexander <peter.alexander.au at gmail.com> 2010-10-23 12:39:50 PDT ---
Simpler test case:

----

void main()
{
    { static int foo; }
    { static int foo; }
}

$ rdmd test.d
ld: duplicate symbol _D4test4mainFZv3fooi in
/tmp/.rdmd/rdmd-test.d-801BCEFE1CAD8F2472CC2713A3BF5714/test.d.o and
/tmp/.rdmd/rdmd-test.d-801BCEFE1CAD8F2472CC2713A3BF5714/test.d.o
collect2: ld returned 1 exit status

----

Unfortunately I'm not sure whether this is supposed to be an error or not.
Obviously D doesn't consider scope for the mangled names of static local
variables, but if this is meant to be an error then it should be a compiler
error, not linker 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