<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:jonathan.sauer@gmx.de" title="jonathan.sauer@gmx.de">jonathan.sauer@gmx.de</a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Lambda inside lambda doesn't capture the variable"
   href="http://llvm.org/bugs/show_bug.cgi?id=18780">bug 18780</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>jonathan.sauer@gmx.de
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>INVALID
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Lambda inside lambda doesn't capture the variable"
   href="http://llvm.org/bugs/show_bug.cgi?id=18780#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Lambda inside lambda doesn't capture the variable"
   href="http://llvm.org/bugs/show_bug.cgi?id=18780">bug 18780</a>
              from <span class="vcard"><a class="email" href="mailto:jonathan.sauer@gmx.de" title="jonathan.sauer@gmx.de">jonathan.sauer@gmx.de</a>
</span></b>
        <pre>The lambda function that is assigned to a->on_run captures on_create's
parameter <a> by reference instead of by value, i.e. it accesses a position in
the stack which can and will be reused later on. To test this add a function
<bar> that uses some stack space:

void bar()
{
  int s[] = { 1, 2, 3, 4, 5 };
}

and then call it before on_run:

  a.a = 1;
  bar();
  a.on_run();

Capturing <a> by value should make your code work as expected (it does on my
computer). Otherwise please feel free to reopen this bug.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>