Bug 11623 – Undefined symbol for static inner class extending template class in trait delegate
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-27T14:56:00Z
Last change time
2015-08-10T15:30:52Z
Assigned to
nobody
Creator
luis
Comments
Comment #0 by luis — 2013-11-27T14:56:15Z
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 { }
});
}