Bug 14588 – [REG2.067] undefined reference error while linking with -debug option to a static library.
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-05-15T16:46:00Z
Last change time
2017-07-22T12:36:01Z
Keywords
link-failure, pull
Assigned to
nobody
Creator
elvis.x.zhou
Comments
Comment #0 by elvis.x.zhou — 2015-05-15T16:46:33Z
//testa.d
module testa.d;
void func(alias a, T, R...)()
{
}
class A
{
int i;
void all(T...)()
{
func!(i,T)();
}
}
//test.d
import testd;
void main()
{
new A().all!int();
}
dmd -debug -lib testa.d //ok
dmd -debug test.d testa.d //ok
dmd test.a testa.a //ok
dmd -debug test.d testa.a //error, undefined reference to func
Comment #1 by elvis.x.zhou — 2015-05-15T16:52:19Z
This is happened under dmd 2.067 and seems no problem with dmd 2.065
Comment #2 by ryan — 2015-05-16T13:14:40Z
More detail:
The following works:
------------------------
//testa.d
module testa.d;
void func(alias a)()
{
}
class A
{
int i;
void all()
{
func!(i)();
}
}
---------------------
The following fails:
---------------------
//testa.d
module testa.d;
void func(alias a)()
{
}
class A
{
int i;
void all()()
{
func!(i)();
}
}
Note the addition of an empty compile-time parameter list
Comment #3 by dlang-bugzilla — 2015-05-17T05:54:25Z