Mercurial > projects > ldc
view tests/mini/foreach10.d @ 1327:49fd0c8040e6
Added reference to DMD bug for latest dstress "regressions" compile/m/mixin_29_E.d and compile/m/mixin_29_F.d .
author | Tomas Lindquist Olsen <tomas.l.olsen gmail com> |
---|---|
date | Sun, 10 May 2009 00:50:35 +0200 |
parents | 8baf611f0009 |
children |
line wrap: on
line source
module foreach10; extern(C) int printf(char*, ...); void main() { char* last = null; printf("The addresses should increment:\n"); foreach (ref c; "bar") { auto a = { printf("%x '%c'\n", c, c); return &c; }; auto nw = a(); printf("ptr = %p\n", nw); if (last != null) assert(nw == last+1); last = nw; } }