Comment #0 by siegelords_abode — 2013-06-20T09:05:03Z
DMD version 2.063.0 through .2. Worked ok in 2.062. 32/64 bit Linux.
This needs two files, test.d and bug.d
///////////
module test;
import bug;
void main()
{
}
///////////
module bug;
struct A()
{
int opCmp(const ref A p) const
{
return 0;
}
string toString()
{
return "";
}
}
struct B()
{
void foo()
{
auto a = new A!();
}
}
struct C
{
alias A!() a_t;
this(B!() b)
{
}
}
When compiled this way there are no errors:
dmd test.d bug.d
However, when compiled this way I get link errors:
dmd -c bug.d && dmd test.d bug.o
test2.o:(.data._D23TypeInfo_S3bug6__T1AZ1A6__initZ+0x40): undefined reference to `_D3bug6__T1AZ1A5opCmpMxFKxS3bug6__T1AZ1AZi'
test2.o:(.data._D23TypeInfo_S3bug6__T1AZ1A6__initZ+0x48): undefined reference to `_D3bug6__T1AZ1A8toStringMFZAya'
Comment #1 by andrej.mitrovich — 2013-06-20T09:30:06Z
Tried on Windows but it works there, it's maybe a posix-only issue.
Comment #2 by hsteoh — 2013-06-29T11:03:51Z
Reproduced this problem on my Linux amd64 box with dmd git HEAD.
Comment #3 by hsteoh — 2013-06-29T11:42:04Z
git bisect indicates that the offending commit was 67fbf5753e9d4a276c354e952ed2f888efcb714c, which was apparently a fix for issue 7511.