www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14588] New: undefined reference error while linking with

https://issues.dlang.org/show_bug.cgi?id=14588

          Issue ID: 14588
           Summary: undefined reference error while linking with -debug
                    option to a static library.
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: pycerl qq.com

//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

--
May 15 2015