D-Programming-Language/dmd — pull request #1808 by donc (2013-03-28 08:42:47+00:00)
Title: Clean up CTFE treatment of forward referenced variables

If a variable is forward referenced, it may be used in CTFE before it has had a semantic2 pass run on it. This means it hasn't had const-folding run on its initializer yet.
When CTFE executed v->init->toExpression(), the semantic gets run, but the result was discarded (not saved back into v).
If the same variable is used elsewhere in CTFE, the semantic would get run on it again...

As well as being inefficient, this causes problems for any attempt to JIT the CTFE code.