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