bug?
Jonathan M Davis via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Sep 15 07:42:13 PDT 2016
On Thursday, September 15, 2016 14:07:18 deed via Digitalmars-d-learn wrote:
> On Thursday, 15 September 2016 at 13:57:13 UTC, rikki cattermole
>
> wrote:
> > Not a bug, it is never used.
>
> I'd expect an "Error: ... no effect ..." from the compiler.
That would only work in fairly simplistic cases. For instance, if you were
allocating an array of structs instead of an array of ints, then it _could_
have an effect. So, it's not an error that would catch much. And it's not
like the code is doing anything illegal - just useless, which is why it gets
optimized out.
- Jonathan M Davis
More information about the Digitalmars-d-learn
mailing list