D-Programming-Language/dmd — pull request #3582 by 9rnsr (2014-05-25 15:03:24+00:00)
Title: Issue 12642 - Avoid some heap allocation cases for fixed-size arrays

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

Improve `@nogc` and `-vgc` behavior.

Points:
- `@nogc` semantics and the report of `-vgc` switch should be consistent each other.

- Check @nogc-ness per statements.
We cannot check `@nogc`-ness in `Expression::semantic`, because some expressions may remove GC allocation after `semantic` done (See the cases in issue 12642).

- NewExp + variable declaration with `scope` attribute should not be marked as `@nogc` excepting class allocations.
It's a current codegen limitation that comes from `NewExp::toElem`.