================ @@ -15845,8 +15845,10 @@ void Sema::CheckCoroutineWrapper(FunctionDecl *FD) { RecordDecl *RD = FD->getReturnType()->getAsRecordDecl(); if (!RD || !RD->getUnderlyingDecl()->hasAttr<CoroReturnTypeAttr>()) return; - // Allow `get_return_object()`. - if (FD->getDeclName().isIdentifier() && + // Allow some_promise_type::get_return_object(). + // Since we are still in the promise definition, we can only do this + // heuristically as the promise may not be yet associated to a coroutine. + if (isa<CXXMethodDecl>(FD) && FD->getDeclName().isIdentifier() && FD->getName().equals("get_return_object") && FD->param_empty()) return; ---------------- usx95 wrote:
At this point (in `ActOnFinishFunctionBody`), neither `CoroDisableLifetimeBoundAttr` nor `CoroWrapperAttr` would be available since these are only built once we encounter a coroutine body. https://github.com/llvm/llvm-project/pull/77066 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits