Bug 1911 – Link error when creating array of typedefs with default initializer

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2008-03-12T06:37:00Z
Last change time
2015-06-09T05:14:44Z
Keywords
link-failure
Assigned to
ibuclaw
Creator
matti.niemenmaa+dbugzilla

Comments

Comment #0 by matti.niemenmaa+dbugzilla — 2008-03-12T06:37:58Z
In file a.d: -- typedef int foo = 1; -- In file b.d: -- import a; void main() { foo[] x = new foo[1]; } -- Compiling with "gdmd ./b.d ./a.d": b.o:(.data._D16TypeInfo_T1a3foo6__initZ[_D16TypeInfo_T1a3foo6__initZ]+0x18): undefined reference to `___s.904' collect2: ld returned 1 exit status Compiling in the order "gdmd ./a.d ./b.d" works, however. This only happens with GDC (latest trunk) and not DMD. I marked this as 'major' since it's tedious to find out which files the problem is in, so that one can link in the correct order.
Comment #1 by ibuclaw — 2010-11-03T14:44:14Z
FYI, this issue is fixed, I'll push it into the tip later.
Comment #2 by ibuclaw — 2010-11-03T16:21:06Z