<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/149477>149477</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [lldb][import-std-module] Clang parser assertion when using lambda is imported from std module
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            lldb
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Michael137
      </td>
    </tr>
</table>

<pre>
    This is a follow-up to https://github.com/llvm/llvm-project/pull/149390

https://github.com/llvm/llvm-project/pull/147389 introduced code in the `fstream` header that was using a function local lambda. This caused following `import-std-module` tests to fail:
```
16:22:51  ********************
16:22:51  Unresolved Tests (2):
16:22:51    lldb-api :: commands/expression/import-std-module/list-dbg-info-content/TestDbgInfoContentListFromStdModule.py
16:22:51 lldb-api :: commands/expression/import-std-module/list/TestListFromStdModule.py
```
with following assertion:
```
Assertion failed: (capture_size() == Class->capture_size() && "Wrong number of captures"), function LambdaExpr, file ExprCXX.cpp, line 1277.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
```

For now this was worked around by moving the lambda into a helper method. But we should really fix the underlying issue so libc++ is free to use whatever idioms they want to.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykVF1r7DYQ_TXal2GNPV6v7Qc_ONkYCrlQuLf0vhVZGq_VK0tGH9lsf32RsyG3SfuSgsBYGh2dOTNnuPfqbIg6Vt2x6rTjMczWdV-UmDnpoqx3o5XX7tusPCgPHCartb3s4wrBwhzC6lnZMxwYDmcV5jhmwi4MB62fXj_71dk_SQSGwxq1ZjgUh7Zsc5b3LO8_j1GXTQvKBGdlFCRBWEmgDISZgB3zyQdHfGHHHGbikhyEmQe4cA_RK3NOyUQjgrIGtBVcg-bLKHkGW7aCR0_ylm8KZ8dcLat1Ye-D3C9WRk0JPJAPPqkxcaVTInnPjvlt5X1xZGWPyM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