[Issue 13350] New: is(typeof(fun)) causes link error when template fun calls undefined reference
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Aug 21 11:24:57 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13350
Issue ID: 13350
Summary: is(typeof(fun)) causes link error when template fun
calls undefined reference
Product: D
Version: D2
Hardware: All
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: monarchdodra at gmail.com
//----
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
--
More information about the Digitalmars-d-bugs
mailing list