The following code executes successfully with 2.074.1 but segmentation faults with 2.075.0-b4: ---------------------------------------------------- import std.stdio; struct Test { void delegate() testBody; Exception unexpected; void opBinary(string op)(void delegate() fun) { testBody = fun; // Call it try testBody(); catch (Exception ex) unexpected = ex; } } struct URL { string fragment; } struct JsonCube { URL dataURL; } struct JsonCubeDef { JsonCube _def; this(string) { } } immutable TEST_JSON = `{}`; void main() { auto def = cast(immutable) JsonCubeDef(TEST_JSON); Test() in { writeln(def); }; }
Introduced by https://github.com/dlang/dmd/pull/6852
We'll address this with 2.075.1 to not delay the release even further.
I cannot reproduce this. What switches are used? Anyhow, it appears to be the same issue as 17622.
I don't have to pass any switches to cause this behavior: $ which rdmd /home/brian/.dvm/compilers/dmd-2.075.0/linux/bin/rdmd $ rdmd test.d Segmentation fault Running on 64-bit Linux.
*** This issue has been marked as a duplicate of issue 17622 ***
I can confirm that this bug no longer happens in Emsi's code with 2.075.1.