www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11623] New: Undefined symbol for static class extending template class in trait delegate

https://d.puremagic.com/issues/show_bug.cgi?id=11623

           Summary: Undefined symbol for static class extending template
                    class in trait delegate
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: luis luismarques.eu


--- Comment #0 from Luís Marques <luis luismarques.eu> 2013-11-27 14:56:15 PST
---
Possibly related to Issue 11622 (just add the static), the following produces
an undefined symbol:

    class A(T)
    {
        B!T foo()
        {
            return new B!T;
        }
    }

    class B(T) : T
    {
    }

    void main()
    {
        auto x = __traits(compiles,
        {
            static class C : A!C { }
        });
    }

Undefined symbols for architecture x86_64:
  "_D4test4mainFZv9__lambda1MFZ1C7__ClassZ", referenced from:
      _D4test36__T1BTC4test4mainFZv9__lambda1MFZ1CZ1B7__ClassZ in test.o

This works though:

    void foo(void delegate() dg) {}

    void main()
    {
        foo(
        {
            static class C : A!C { }
        });
    }

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 27 2013