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

Andreas Fertig via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 10 23:00:19 PDT 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()) {
----------------
andreasfertig wrote:

Good catch, thanks!

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


More information about the cfe-commits mailing list