title: Generic lambda with std::function does not capture variables
body: <p>I'm trying to use the generic lambda of C++14, but got a trouble with std::function.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;functional&gt;
  
  int main()
  {
      const int a = 2;
      std::function&lt;void(int)&gt; f = [&amp;](auto b) { std::cout &lt;&lt; a &lt;&lt; ", " &lt;&lt; b &lt;&lt; std::endl; };
      f(3);
  }
  </code></pre>
  
  <p>This fails to compile with an error message saying that <code>error: ‘a’ was not declared in this scope</code>.</p>
  
  <p>It works if I change it to <code>(int b)</code>.</p>
  
  <p>Is it a bug? or am I missing something?</p>
  
  <p>The version of GCC i'm using is 4.9.2.</p>