title: C++ lambda expression does not compile
body: <p>I am trying to <code>cin</code> a loop index's value in the loop itself using lambda expression:</p>
  
  <pre><code>#include&lt;iostream&gt;
  using namespace std;
  
  int main(){
    for(int a, ([](int &amp; b){cin&gt;&gt;b;})(a); a &lt; 2; ++a);
    return 0;
  }
  </code></pre>
  
  <p>These are the errors when i compile using g++ 4.5 on ubuntu:</p>
  
  <pre><code>forLoopAndCinTest.c++: In function ‘int main()’:
  forLoopAndCinTest.c++:5:14: error: expected unqualified-id before ‘[’ token
  forLoopAndCinTest.c++:5:14: error: expected ‘)’ before ‘[’ token
  forLoopAndCinTest.c++:5:34: error: expected primary-expression before ‘)’ token
  forLoopAndCinTest.c++:5:34: error: expected ‘;’ before ‘)’ token
  forLoopAndCinTest.c++:5:40: error: name lookup of ‘a’ changed for ISO ‘for’ scoping
  forLoopAndCinTest.c++:5:40: note: (if you use ‘-fpermissive’ G++ will accept your code)
  forLoopAndCinTest.c++:5:50: error: expected ‘;’ before ‘)’ token
  </code></pre>
  
  <p>If i use a normal function instead of the lambda, program compiles fine.<br>
   Using -fpermissive doesnt help either.<br>
   Any ideas?</p>