[clang] [coroutines] Introduce [[clang::coro_not_lifetimebound]] (PR #76818)

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 3 06:22:19 PST 2024


================
@@ -7671,9 +7671,12 @@ The ``[[clang::coro_lifetimebound]]`` is a class attribute which can be applied
 to a coroutine return type (`CRT`_) (i.e.
 it should also be annotated with ``[[clang::coro_return_type]]``).
 
-All parameters of a function are considered to be lifetime bound. See `documentation`_
-of ``[[clang::lifetimebound]]`` for more details.
-if the function returns a coroutine return type (CRT) annotated with ``[[clang::coro_lifetimebound]]``.
+All parameters of a function are considered to be lifetime bound if the function returns a
----------------
ilya-biryukov wrote:

Would it be useful to have an attribute like this on individual parameters?
I suspect it might happen in practice that some, but not all, parameters have this property. It's probably pretty rare, but I would ask people writing coroutine code to get their opinion. (We could always generalize to parameters later if the answer is inconclusive).





https://github.com/llvm/llvm-project/pull/76818


More information about the cfe-commits mailing list