[clang] [coroutines][coro_lifetimebound] Detect lifetime issues with lambda captures (PR #77066)

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 17 10:08:19 PST 2024


================
@@ -11220,6 +11220,11 @@ class Sema final {
   VarDecl *buildCoroutinePromise(SourceLocation Loc);
   void CheckCompletedCoroutineBody(FunctionDecl *FD, Stmt *&Body);
 
+  // Heuristically tells if the function is get_return_object by matching
----------------
ilya-biryukov wrote:

I think it's useful to mention that `get_return_object` is coming from the coroutine's `promise_type` as defined by the C++ standard. (I think it might not be obvious).

Also, could we change the name to something like `CanBeReturnObject` to clearly indicate it's a heuristic to the users.



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


More information about the cfe-commits mailing list