Skip to content

Member function: Passing object by value cause dangling #12

@LesleyLai

Description

@LesleyLai
struct S {
  int foo() const { return 3; }
};

int main() {
    tl::function_ref<int(S)> f = &S::foo;
    f(S{}); // crash with GCC 9.1
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions