File structure:
a.d
b.d
---- a.d ----
import std.algorithm;
import b;
void main()
{
int[] foo;
setUnion(fun()[], foo);
}
---- b.d ----
module b;
auto fun()
{
import std.container;
return redBlackTree!int;
}
------------------
Compiling using `dmd -c a.d && dmd -c b.d && dmd *.o` succeeds except for linker error:
a.o: In function `_D3std9algorithm6setops119__T8SetUnionVAyaa5_61203c2062TS3std9container6rbtree41__T12RedBlackTreeTiVAyaa5_61203c2062Vbi0Z12RedBlackTree5RangeTAiZ8SetUnion9__xtoHashFNbNeKxS3std9algorithm6setops119__T8SetUnionVAyaa5_61203c2062TS3std9container6rbtree41__T12RedBlackTreeTiVAyaa5_61203c2062Vbi0Z12RedBlackTree5RangeTAiZ8SetUnionZm':
a.d:(.text._D3std9algorithm6setops119__T8SetUnionVAyaa5_61203c2062TS3std9container6rbtree41__T12RedBlackTreeTiVAyaa5_61203c2062Vbi0Z12RedBlackTree5RangeTAiZ8SetUnion9__xtoHashFNbNeKxS3std9algorithm6setops119__T8SetUnionVAyaa5_61203c2062TS3std9container6rbtree41__T12RedBlackTreeTiVAyaa5_61203c2062Vbi0Z12RedBlackTree5RangeTAiZ8SetUnionZm+0x18): undefined reference to `_D95TypeInfo_xS3std9container6rbtree41__T12RedBlackTreeTiVAyaa5_61203c2062Vbi0Z12RedBlackTree5Range6__initZ'
a.d:(.text._D3std9algorithm6setops119__T8SetUnionVAyaa5_61203c2062TS3std9container6rbtree41__T12RedBlackTreeTiVAyaa5_61203c2062Vbi0Z12RedBlackTree5RangeTAiZ8SetUnion9__xtoHashFNbNeKxS3std9algorithm6setops119__T8SetUnionVAyaa5_61203c2062TS3std9container6rbtree41__T12RedBlackTreeTiVAyaa5_61203c2062Vbi0Z12RedBlackTree5RangeTAiZ8SetUnionZm+0x1f): undefined reference to `_D95TypeInfo_xS3std9container6rbtree41__T12RedBlackTreeTiVAyaa5_61203c2062Vbi0Z12RedBlackTree5Range6__initZ'
collect2: error: ld returned 1 exit status
--- errorlevel 1
Linker error happens with 2.068.2 but does not happen with 2.067.1.
Comment #1 by bugzilla — 2015-10-04T03:29:27Z
If you compile with -allinst dmd switch, does it work?
Comment #2 by yazan.dabain — 2015-10-04T05:30:52Z
It does compile with -allinst as a workaround.
This is a reduction of a project with multiple dependencies built using dub. My current workaround is using `dub --combined` to disable separate compilation.
It is not blocking me but it is a regression.
Comment #3 by k.hara.pg — 2015-10-06T12:29:11Z
Happens from 2.068.1.
The link-failure reproduces with -g switch in win32.