================
@@ -777,6 +777,12 @@ void CodeGenFunction::EmitCoroutineBody(const 
CoroutineBodyStmt &S) {
 
   // LLVM require the frontend to mark the coroutine.
   CurFn->setPresplitCoroutine();
+
+  {
+    CXXRecordDecl *RD = FnRetTy->getAsCXXRecordDecl();
+    if (RD && RD->hasAttr<CoroOnlyDestroyWhenCompleteAttr>())
+      CurFn->setCoroDestroyOnlyWhenDone();
+  }
----------------
tbaederr wrote:

```suggestion
  if (const CXXRecordDecl *RD = FnRetTy->getAsCXXRecordDecl();
      RD && RD->hasAttr<CoroOnlyDestroyWhenCompleteAttr>())
    CurFn->setCoroDestroyOnlyWhenDone();
```

https://github.com/llvm/llvm-project/pull/71014
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to