title: Are const static fields removed from the AST once they're evaluated? (optimisation)
body: <p>In a for loop such as:</p>
  <pre><code>for(int i = 0; i &lt; 10000; i ++) {
      const static int test = i;
      ...
  }
  </code></pre>
  <p>Since <code>test</code> can only be assigned to once (const) AND the it will not be stored in the stack (static) is it a compiler optimisation to completely remove the AST of <code>const static int test = i;</code> from the for loop block, in order to decrease the chance of cache misses during runtime, as less children are stored in the for loop's body? If not why?</p>
  <p>My thought process behind this, is that once <code>test</code> is evaluated, further evaluation of <code>test</code> is ignored as it is <code>const static</code>. Therefore the AST of the <code>test</code> is no longer required.</p>