-
-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CppInsights crash with stack dump #526
Labels
bug
Something isn't working
Comments
Seems that the root of evil here is CRTP, cause code below compiles without any issues: #include <coroutine>
#include <iostream>
#include <exception>
struct hello_logic {
bool await_ready() const noexcept { return true; }
void await_suspend(std::coroutine_handle<>) const noexcept { }
void await_resume() const noexcept { std::cout << "Hello, world" << std::endl; }
};
struct hello_world {
struct promise_type {
auto get_return_object() { return hello_world(this); }
std::suspend_never initial_suspend() noexcept { return {}; }
std::suspend_never final_suspend() noexcept { return {}; }
void return_void() { }
void unhandled_exception() { }
};
using coro_handle = std::coroutine_handle<promise_type>;
hello_world(promise_type* promise) : handle_(coro_handle::from_promise(*promise)) { }
static hello_world execute() { co_await hello_logic{}; }
private:
coro_handle handle_;
};
int main() { hello_world::execute(); } |
Hello @PatriotRossii, thanks for reporting this! Very interesting test code. Aside from the crash, it also contains a The issue at hand seems to come from the code I create for the coroutine. I need more time to look into this and how to fix it. Andreas |
andreasfertig
added a commit
that referenced
this issue
Jun 27, 2023
Fixed #526: Don't try to expand a primary class template with coroutine.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code (environment: C++23, show coroutine transformation):
Console:
The text was updated successfully, but these errors were encountered: