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.
Comment #1 by k.hara.pg — 2013-10-30T21:21:20Z
Comment #2 by github-bugzilla — 2013-10-31T01:44:00Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/f70c40dce3928ddd2c2d4fc886f66e0587509487 fix Issue 11395 - link error (struct+opEquals) on separate compilation https://github.com/D-Programming-Language/dmd/commit/9dabf26ab0edf216c994137e09a58db6d509669a Merge pull request #2698 from 9rnsr/fix11395 [REG2.064a] Issue 11395 - link error (struct+opEquals) on separate compilation
Comment #3 by github-bugzilla — 2013-10-31T01:44:40Z
Commit pushed to 2.064 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/b52c07181deed50fdbff5efc019906b3803d924c Merge pull request #2698 from 9rnsr/fix11395 [REG2.064a] Issue 11395 - link error (struct+opEquals) on separate compilation