| Issue |
123300
|
| Summary |
Clang-repl fails while trying Lambdas with capture
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
anutosh491
|
Unfortunately I didn't have clang-repl built locally while trying this but I tried in through xeus-cpp (a C++ Jupyter Kernel that is based on clang-repl) and also through xeus-cpp-lite (xeus-cpp + jupyterlite that helps run clang-repl completely in the browser, here's a link to try it out https://compiler-research.github.io/xeus-cpp/lab/index.html
The following fails (or rather leads to a kernel crash in my case)
```
int x = 42;
auto capture = [&]() { return x * 2; };
std::cout << capture() << "\n"; // Output: 84
```

The error message is this

```
Assertion failed: getPtr() && "getFETokenInfo on an empty DeclarationName!", at: /home/runner/work/recipes/recipes/output/bld/rattler-build_llvm_1734801187/work/clang/include/clang/AST/DeclarationName.h,503,getFETokenInfo)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs