[Issue 19598] CTFE fails to assign struct

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 21 07:34:23 UTC 2019


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

--- Comment #5 from Simen Kjaeraas <simen.kjaras at gmail.com> ---
Workaround #2: 
int test2()
{
    struct S { int x;  }
    S t1;
    S* n1 = &(new S[1])[0];
    *n1 = t1;

    return 10;
}
pragma(msg, test2());

Something gets weird when using `new S` - it seems the allocated block is
marked in some way that prevents *m1 = t1 from working.

--


More information about the Digitalmars-d-bugs mailing list