-
-
Notifications
You must be signed in to change notification settings - Fork 262
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Code (environment: C++23, show coroutine transformation):
#include <coroutine>
#include <iostream>
#include <exception>
template <typename T, typename U>
struct executable { static U execute() { co_await T{}; } };
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 : executable<hello_logic, 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)) { }
private:
coro_handle handle_;
};
int main() { hello_world::execute(); }Console:
insights: /usr/include/llvm-15/llvm/Support/Casting.h:109: static bool llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To = clang::Expr; From = clang::Stmt]: Assertion `Val && "isa<> used on a null pointer"' failed.
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
[0x1daef61]
[0x1dacc7c]
[0x1daf486]
[0x1ea4460]
[0x1ec41dc]
[0x1ea43e6]
[0x40390a]
[0x403832]
[0x1e9e036]
[0x502110]
[0x4cb2a0]
[0x4ac72c]
[0x496383]
[0x473fed]
[0x4568ed]
[0x42abd6]
[0x42be84]
[0x40e0b7]
[0x4186e2]
[0x40acc9]
[0x5670a5]
[0x40b643]
[0x4122c1]
[0x4123f3]
[0x417e4d]
[0x415df6]
[0x40c7bf]
[0x5aebc3]
[0x60a06c]
[0x63dd0c]
[0x609a9e]
[0x60c6c1]
[0x614f4b]
[0x60c6f9]
[0x5dc401]
[0x58b0ba]
[0xab157b]
[0x6f2ba7]
[0x664ce6]
[0x5cd071]
[0x5ccddf]
[0x5cbd1f]
[0x5ce90e]
[0x5882f9]
[0x1e8bdda]
[0x1e8d637]
[0x406d55]
Aborted (core dumped)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working