Why is 'int i = i;' legal?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3173462/int-var-1-void-main-int-i-i">int var = 1; void main() { int i = i; }</a>  </p>
</blockquote>



<p>The following code can pass compiling under both g++ and Visual C++.  Why is it legal?  It looks unreasonable, and may cause hidden bugs.</p>

<pre><code>int main() {
  int i = i;
}
</code></pre>
