[clang] [coroutines] Introduce [[clang::coro_return_type]] and [[clang::coro_wrapper]] (PR #71945)
Chuanqi Xu via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 15 19:24:29 PST 2023
================
@@ -300,6 +300,11 @@ Attribute Changes in Clang
to reduce the size of the destroy functions for coroutines which are known to
be destroyed after having reached the final suspend point.
+- Clang now introduced ``[[clang::coro_return_type]]`` and ``[[clang::coro_wrapper]]``
+ attributes. A function returning a type marked with ``[[clang::coro_return_type]]``
+ should be a coroutine. A non-coroutine function marked with ``[[clang::coro_wrapper]]``
+ is still allowed to return the such a type.
----------------
ChuanqiXu9 wrote:
```suggestion
is still allowed to return the such a type. This is helpful for analyzers to recognize coroutines from the function signatures.
```
nit. Not required. But I feel it reads better if I can understand the intention here.
https://github.com/llvm/llvm-project/pull/71945
More information about the cfe-commits
mailing list