[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


================
@@ -15841,13 +15841,24 @@ static void diagnoseImplicitlyRetainedSelf(Sema &S) {
           << FixItHint::CreateInsertion(P.first, "self->");
 }
 
+bool Sema::IsGetReturnObject(const FunctionDecl *FD) {
+  return isa<CXXMethodDecl>(FD) && FD->param_empty() &&
----------------
ilya-biryukov wrote:

NIT: maybe share the code between two functions? 
I am also not sure whether `isa<CXXMethodDecl>()` should also be added to the other check (aren't static functions also instances of `CXXMethodDecl`?)

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


More information about the cfe-commits mailing list