[clang] [C++20][Coroutines] lambda-coroutine with promise_type ctor. (PR #84519)

via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 9 03:28:52 PST 2024


================
@@ -596,8 +596,21 @@ VarDecl *Sema::buildCoroutinePromise(SourceLocation Loc) {
 
   // Add implicit object parameter.
   if (auto *MD = dyn_cast<CXXMethodDecl>(FD)) {
-    if (MD->isImplicitObjectMemberFunction() && !isLambdaCallOperator(MD)) {
-      ExprResult ThisExpr = ActOnCXXThis(Loc);
+    if (MD->isImplicitObjectMemberFunction()) {
+      ExprResult ThisExpr{};
+
+      if (isLambdaCallOperator(MD) && !MD->isStatic()) {
----------------
cor3ntin wrote:

`MD->isStatic()` can never be true (because `isImplicitObjectMemberFunction` is true)

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


More information about the cfe-commits mailing list