================
@@ -15811,6 +15813,20 @@ static void diagnoseImplicitlyRetainedSelf(Sema &S) {
           << FixItHint::CreateInsertion(P.first, "self->");
 }
 
+void Sema::CheckCoroutineWrapper(FunctionDecl *FD) {
+  if (!FD || getCurFunction()->isCoroutine())
----------------
ilya-biryukov wrote:

It's not clear at all from the code now that `FD` and `getCurFunction()` must 
correspond to the code.
As we chatted offline, moving the check `getCurFunction()->isCoroutine()` into 
the callers and checking only the attributes in this function would make it 
much easier to understand the code.

Let's do that?

Alternatively, we could add some assertion that checks the `getCurFunction()` 
and `FD` correspond to the same function.

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

Reply via email to