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

           Summary: multiple definitions with typeid and multiobj
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: d...@dawgfoto.de


--- Comment #0 from d...@dawgfoto.de 2011-08-09 15:43:49 PDT ---
--- tmpl.d:
module tmpl;
struct Tmpl(T) {
  T a;
}

---- a.d:
module a;
import tmpl;
TypeInfo fun() { return typeid(Tmpl!int()); }

--- b.d:
module b;
import tmpl;
TypeInfo fun() { return typeid(Tmpl!long()); }

--- main.d:
import a, b;
void main() {
  auto t1 = a.fun();
  auto t2 = b.fun();
  assert(t1 != t2);
}

reproduce:
dmd -lib -ofliba.a a
dmd -lib -oflibb.a b
dmd main -L-L. -L-la -L-lb

This bug is caused by Type::getTypeInfo causing a call to obj_append while
already being in a deferred genobjfile. The appended symbol is not marked as
doppelganger module thus writes out ModuleAssert, ModuleArray et al. Now two
different libraries can end up with colliding definitions if count in
obj_write_deferred is accidentally the same.

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

Reply via email to