Bug 11395 – link error (struct+opEquals) on separate compilation
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-30T19:32:00Z
Last change time
2013-10-31T01:45:33Z
Keywords
link-failure, pull
Assigned to
nobody
Creator
mk
Comments
Comment #0 by mk — 2013-10-30T19:32:22Z
----------------
module stru;
struct StruB
{
bool flag;
int[] nums;
bool opEquals(bool b) { return flag == b; }
}
struct StruA
{
int num;
StruB sb;
}
----------------
module main;
import stru;
StruA[] arr;
void main()
{
StruA s;
arr ~= s;
}
-----------------
dmd -c stru.d
dmd -c main.d
dmd main.o stru.o
main.o:(.data._D21TypeInfo_S4stru5StruA6__initZ+0x1c): undefined reference to `_D4stru5StruA11__xopEqualsFKxS4stru5StruAKxS4stru5StruAZb'
collect2: ld returned 1 exit status
--- errorlevel 1
DMD32 D Compiler v2.064-devel-e5a0c64 Linux
This is a regression against earlier 2.064 or 2.063.2
Adding opEquals to StruA or a single command compilation both solves the problem, so feel free to downgrade.