[Issue 15862] Functions that return types with mutable indirections should be weakly pure, not strongly pure

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Oct 14 14:33:37 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=15862

--- Comment #9 from Andrei Alexandrescu <andrei at erdani.com> ---
(In reply to Walter Bright from comment #7)
> Yeah, my mistake. The compiler should consider @nogc when marking a pure
> function as a common subexpression.

Nononononono, @nogc has nothing to do with it. Think malloc and allocators. The
compiler should consider functions that return data with mutable indirections
weakly pure, regardless. Then they won't be subject to CSE and everything will
work well.

--


More information about the Digitalmars-d-bugs mailing list