gracicot / gracicot/impossible-callback

Cannot use impossible callback with unknown inheritance on msvc

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Using a pointer to member function of unknown inheritance leads to a segmentation fault.

```
struct A;

void boom(A* o, auto(A::*f)() -> void) {
auto [object, function] = impossible_callback(o, f);
std::invoke(function, object); // segfault!
}

struct A {
auto function() -> void {}
};

int main() {
A a;
boom(&a, &A::function);
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.