================ @@ -15811,6 +15813,20 @@ static void diagnoseImplicitlyRetainedSelf(Sema &S) { << FixItHint::CreateInsertion(P.first, "self->"); } +void Sema::CheckCoroutineWrapper(FunctionDecl *FD) { + if (!FD || getCurFunction()->isCoroutine()) + return; + RecordDecl *RD = FD->getReturnType()->getAsRecordDecl(); + if (!RD || !RD->getUnderlyingDecl()->hasAttr<CoroReturnTypeAttr>()) + return; + // Allow `get_return_object()`. ---------------- ilya-biryukov wrote:
NIT: you might want to add a mention in documentation that `PromiseType::get_return_object` are exempt of this analysis as it is a necessary implementation detail of any coroutine library. 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