[dmd-beta] D 2.059 beta 4

Sönke Ludwig sludwig at outerproduct.org
Mon Apr 9 02:06:20 PDT 2012


Another similar case reduced from a large code base (B having no fields 
does not play a role):
---
struct B {}
struct C { B b; }
C func() { C b = void; b.b = B(); return b; }
C test = func();
---
Assertion failed: (dest->op == TOKstructliteral || dest->op == 
TOKarrayliteral || dest->op == TOKstring), function assignInPlace, file 
interpret.c, line 3390.

Am 09.04.2012 09:28, schrieb Sönke Ludwig:
> One more regression:
>
> ---
> struct S {
>     int n[1];
>     static S test(){ S ret = void; ret.n[0] = 0; return ret; }
> }
>
> enum Test = S.test();
> ---
>
> ctfe_uninit.d(3): Error: cannot read uninitialized variable ret.n in ctfe
> ctfe_uninit.d(3): Error: variable ctfe_uninit.S.test.ret was 
> uninitialized and used before set
>
> There is no hint where the CTFE instantiation that triggered the error 
> is.
>
> Am 09.04.2012 09:01, schrieb Walter Bright:
>>
>> http://ftp.digitalmars.com/dmd2beta.zip
>> _______________________________________________
>> dmd-beta mailing list
>> dmd-beta at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/dmd-beta
>
> _______________________________________________
> dmd-beta mailing list
> dmd-beta at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-beta



More information about the dmd-beta mailing list