This example crashes DMD from Git master when invoked with -g or -gc: --- struct Foo { const(Foo)* bar; } Foo foo; --- (the global is just necessary to trigger debug info generation for Foo). What happens is that that for emitting debug info for const types, a copy of the type is made at https://github.com/D-Programming-Language/dmd/blob/master/src/backend/dwarf.c#L1571, thus breaking the TYforward loop detection mechanism.
https://github.com/D-Programming-Language/dmd/commit/a7df55e4c7de5ab3294bc1111968da5051960a95 https://github.com/D-Programming-Language/dmd/commit/913ab53b0fd6e5b2b597b4661887d0a6fc66eea5
*** Issue 5533 has been marked as a duplicate of this issue. ***
*** Issue 7031 has been marked as a duplicate of this issue. ***