[clang] [coroutines] Introduce [[clang::coro_return_type]] and [[clang::coro_wrapper]] (PR #71945)
Utkarsh Saxena via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 17 05:52:25 PST 2023
================
@@ -15811,6 +15813,20 @@ static void diagnoseImplicitlyRetainedSelf(Sema &S) {
<< FixItHint::CreateInsertion(P.first, "self->");
}
+void Sema::CheckCoroutineWrapper(FunctionDecl *FD) {
+ if (!FD || getCurFunction()->isCoroutine())
----------------
usx95 wrote:
`getCurFunction()` returns the function scope info which contains information about the processed function body being a coroutine or not. FD and getCurFunction() refers to the same function (one is decl and the other is FSI).
I will add a lambda inside a coroutine test to clarify.
https://github.com/llvm/llvm-project/pull/71945
More information about the cfe-commits
mailing list