Skip to content

Clang-repl fails while trying Lambdas with capture #123300

Closed
@anutosh491

Description

@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

The error message is this

Image

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions