================ @@ -8119,6 +8119,35 @@ but do not pass them to the underlying coroutine or pass them by value. }]; } +def CoroAwaitElidableDoc : Documentation { + let Category = DocCatDecl; + let Content = [{ +The ``[[clang::coro_await_elidable]]`` is a class attribute which can be applied +to a coroutine return type. + +When a coroutine function that returns such a type calls another coroutine function, +the compiler performs heap allocation elision when the call to the coroutine function +is immediately co_awaited as a prvalue. ---------------- ChuanqiXu9 wrote:
Yeah, the term "immediate subexpression" is not clear in the standard wording. But we're using a different term "immediately co_awaited". So we're not covering something existed already. The reason why I don't like `prvalue` here is that it didn't interpret the things very clearly. It may make people think they understand it but in fact it is not. In another word, the semantics or intention of the attribute is that, the coroutine instance generated by the targeted call (no matter how we describe it) before we resume the current coroutine. The interesting point here is that, the coroutine instance is not necessarily connected to the return object of that targeted call. They are two different things. But just in the general implementation, the return object of such targeted call may have a pointer pointed to the coroutine instance. But there are indeed differences. https://github.com/llvm/llvm-project/pull/99282 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits