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
```


![Image](https://github.com/user-attachments/assets/4673d628-7a2c-4ac8-81d6-6d093127db5d)

The error message is this 

![Image](https://github.com/user-attachments/assets/e24af605-95ea-4e1c-aa21-cd24663f1892)
```
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
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to