Using newly declared variable in initialization (int x = x+1)?
<p>I just stubled upon a behaviour which surprised me:</p>

<p>When writing</p>

<pre><code>int x = x+1;
</code></pre>

<p>in a C/C++-program (or even more complex expression involving the newly created variable x) my gcc/g++ compiles without errors. In the above case X is 1 afterwards. Note that there is no variable x in scope by a previous declaration.</p>

<p>So I'd like to know whether this is correct behaviour (and even might be useful in some situation) or just a parser pecularity with my gcc version or gcc in general.</p>

<p>BTW: The following does not work.</p>

<pre><code>int x++;
</code></pre>
