[Issue 13381] Two cases of array literal that can be stack-allocated

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Oct 6 10:26:58 PDT 2014


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

--- Comment #13 from bearophile_hugs at eml.cc ---
A case (from Issue 13576 ):


immutable int[] a;
static this() @nogc {
    a = [1];
}
void main() {}


dmd 2.067alpha gives:

temp.d(3,9): Error: array literal in @nogc function _staticCtor1 may cause GC
allocation

--


More information about the Digitalmars-d-bugs mailing list