Skip to content

Crash on https://cppinsights.io when trying code with member variables of type std::function<void()> and assigning it with lambda expression #205

@fadi-botros

Description

@fadi-botros

This code crashed https://cppinsights.io, tried C++11, C++14, C++17 and C++2a

#include <iostream>
#include <functional>
class EventContainer {
    private:
        int val = 1234;
        std::function<void()> something = [=]() {
            std::cout << this->val;
        };
};

int main() {
  return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions