https://issues.dlang.org/show_bug.cgi?id=22372
Walter Bright <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #10 from Walter Bright <[email protected]> --- A simplified version: import core.stdc.stdio; struct S { int a1, a2, a3; } void throws2ndCall(ref S x) { __gshared bool b; if (b) throw new Exception("n == 1"); b = true; } void main() { S[] arr = [S(), S()]; size_t i; try { for (i = 0; i < 2; i++) throws2ndCall(arr[i]); } catch (Exception o) { printf("Exception: i = %lu\n", i); // prints 0 assert(i == 1); // this fails } } --
