[Issue 19598] CTFE fails to assign struct

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


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

Simen Kjaeraas <simen.kjaras at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simen.kjaras at gmail.com

--- Comment #3 from Simen Kjaeraas <simen.kjaras at gmail.com> ---
Defining an opAssign for S seems to do the trick:

int test()
{
    struct S { int x; void opAssign(S s) { x = s.x; } }
    S t1;
    S* n1 = new S;
    *n1 = t1;

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

--


More information about the Digitalmars-d-bugs mailing list