Bug 13350 – is(typeof(fun)) causes link error when template fun calls undefined reference

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2014-08-21T18:24:00Z
Last change time
2014-09-05T09:42:15Z
Keywords
link-failure, pull
Assigned to
nobody
Creator
monarchdodra

Comments

Comment #0 by monarchdodra — 2014-08-21T18:24:57Z
//---- auto red()() { return foo(); } static int foo(); void main(string[] args) { int[] data; assert(is(typeof(red()))); } //---- main.d:(.text._D4main8__T3redZ3redFZi+0x5): undefined reference to `_D4main3fooFZi' //---- This is wrong, since the program never actually needed to call foo. Seems to only trigger on Linux, and was discovered in Phobos: https://github.com/D-Programming-Language/phobos/pull/2431
Comment #1 by k.hara.pg — 2014-08-24T05:30:09Z
Comment #2 by github-bugzilla — 2014-09-05T09:42:14Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ae716b0859c97a9f22ad616070b3d77e9ca6f088 fix Issue 13350 - is(typeof(fun)) causes link error when template fun calls undefined reference Evaluate the type in IsExp, then unspeculative declared symbols. https://github.com/D-Programming-Language/dmd/commit/a6a5dd2cfb32cba7dca55d261d8ddca4ff482704 Merge pull request #3894 from 9rnsr/fix13350 Issue 13350 - is(typeof(fun)) causes link error when template fun calls undefined reference