https://issues.dlang.org/show_bug.cgi?id=21893
--- Comment #1 from Richard Cattermole <[email protected]> --- cas also appears to suffer from this issue: https://github.com/dlang/druntime/blob/master/src/core/atomic.d#L386 return atomicCompareExchangeStrongNoResult!(succ, fail)(cast(T*)here, *cast(Thunk1*)&ifThis, *cast(Thunk2*)&writeThis); Since this was asked by Herringway on IRC, this was patched live and after patching it no longer appears to call itself recursively. I don't know how valid these proposed fixes are, only it seems to resolve it for my use case (Struct*[2]). --
