[clang] [coroutines] Introduce [[clang::coro_return_type]] and [[clang::coro_wrapper]] (PR #71945)

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 17 05:16:16 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())
----------------
ilya-biryukov wrote:

Why are we disabling this analysis if the current function is a coroutine?
It seems like a red flag, i.e. does this mean that a lambda inside a coroutine can violate the contract? What's the motivation there.

Or am I missing something?

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


More information about the cfe-commits mailing list