1 // https://issues.dlang.org/show_bug.cgi?id=21120 2 3 module one.two.three; 4 5 struct S {} 6 StructTemplate(T)7struct StructTemplate(T) 8 { 9 int a = 123; // non-zero initialized 10 11 ref const(StructTemplate) getInitSymbol() 12 { 13 return initSymbol!StructTemplate; 14 } 15 } 16 initSymbol(T)17template initSymbol(T) 18 { 19 pragma(mangle, "_D" ~ T.mangleof[1..$] ~ "6__initZ") 20 extern immutable T initSymbol; 21 } 22 main()23void main() 24 { 25 StructTemplate!S inst; 26 assert(inst.getInitSymbol() == inst); 27 } 28