llvm-project
35d3b33b - [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (#84193)

Commit
1 year ago
[C++20][Coroutines] Lambda-coroutine with operator new in promise_type (#84193) Fix #84064 According to http://eel.is/c++draft/dcl.fct.def.coroutine#9 the first parameter for overload resolution of `operator new` is `size_t` followed by the arguments of the coroutine function. http://eel.is/c++draft/dcl.fct.def.coroutine#4 states that the first argument is the lvalue of `*this` if the coroutine is a member function. Before this patch, Clang handled class types correctly but ignored lambdas. This patch adds support for lambda coroutines with a `promise_type` that implements a custom `operator new`. The patch does consider C++23 `static operator()`, which already worked as there is no `this` parameter.
Author
Parents
Loading