https://issues.dlang.org/show_bug.cgi?id=2947
--- Comment #8 from yebblies <[email protected]> --- (In reply to Jakob Ovrum from comment #7) > (In reply to Georg Wrede from comment #0) > > ... > > Member field initializers are always evaluated at compile-time so this > behaviour is not a bug. The bug is that the array elements are allocated in > global memory instead of TLS. Only `immutable` and `shared` elements should > be allocated in global memory. We can also do it for `const` elements as > CTFE should always be pure enough to assume uniqueness. > > Same issue as CT initializers of mutable class type, i.e. > > void main() > { > static Object o = new Object; // stored in global memory; should be TLS > } How exactly would putting the array in TLS fix this bug? --
