@@ -418,39 +448,60 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema
, VarDecl *CoroPromise,
return Calls;
}
Expr *CoroHandle = CoroHandleRes.get();
- CallExpr *AwaitSuspend = cast_or_null(
- BuildSubExpr(ACT::ACT_Suspend, "await_suspend", CoroHandle));
@@ -418,39 +448,60 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema
, VarDecl *CoroPromise,
return Calls;
}
Expr *CoroHandle = CoroHandleRes.get();
- CallExpr *AwaitSuspend = cast_or_null(
- BuildSubExpr(ACT::ACT_Suspend, "await_suspend", CoroHandle));
@@ -418,39 +448,60 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema
, VarDecl *CoroPromise,
return Calls;
}
Expr *CoroHandle = CoroHandleRes.get();
- CallExpr *AwaitSuspend = cast_or_null(
- BuildSubExpr(ACT::ACT_Suspend, "await_suspend", CoroHandle));
@@ -418,39 +448,60 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema
, VarDecl *CoroPromise,
return Calls;
}
Expr *CoroHandle = CoroHandleRes.get();
- CallExpr *AwaitSuspend = cast_or_null(
- BuildSubExpr(ACT::ACT_Suspend, "await_suspend", CoroHandle));
https://github.com/yuxuanchen1997 edited
https://github.com/llvm/llvm-project/pull/85684
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -418,39 +448,60 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema
, VarDecl *CoroPromise,
return Calls;
}
Expr *CoroHandle = CoroHandleRes.get();
- CallExpr *AwaitSuspend = cast_or_null(
- BuildSubExpr(ACT::ACT_Suspend, "await_suspend", CoroHandle));
@@ -418,39 +448,60 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema
, VarDecl *CoroPromise,
return Calls;
}
Expr *CoroHandle = CoroHandleRes.get();
- CallExpr *AwaitSuspend = cast_or_null(
- BuildSubExpr(ACT::ACT_Suspend, "await_suspend", CoroHandle));
@@ -418,39 +448,60 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema
, VarDecl *CoroPromise,
return Calls;
}
Expr *CoroHandle = CoroHandleRes.get();
- CallExpr *AwaitSuspend = cast_or_null(
- BuildSubExpr(ACT::ACT_Suspend, "await_suspend", CoroHandle));
https://github.com/yuxuanchen1997 updated
https://github.com/llvm/llvm-project/pull/85684
>From b843c2f71a1a43cb897b557f783d60c6bf26f687 Mon Sep 17 00:00:00 2001
From: Yuxuan Chen
Date: Mon, 18 Mar 2024 10:45:20 -0700
Subject: [PATCH] Check if Coroutine await_suspend type returns the right
@@ -418,39 +448,60 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema
, VarDecl *CoroPromise,
return Calls;
}
Expr *CoroHandle = CoroHandleRes.get();
- CallExpr *AwaitSuspend = cast_or_null(
- BuildSubExpr(ACT::ACT_Suspend, "await_suspend", CoroHandle));
@@ -418,39 +448,60 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema
, VarDecl *CoroPromise,
return Calls;
}
Expr *CoroHandle = CoroHandleRes.get();
- CallExpr *AwaitSuspend = cast_or_null(
- BuildSubExpr(ACT::ACT_Suspend, "await_suspend", CoroHandle));
@@ -418,39 +448,60 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema
, VarDecl *CoroPromise,
return Calls;
}
Expr *CoroHandle = CoroHandleRes.get();
- CallExpr *AwaitSuspend = cast_or_null(
- BuildSubExpr(ACT::ACT_Suspend, "await_suspend", CoroHandle));
@@ -418,39 +448,60 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema
, VarDecl *CoroPromise,
return Calls;
}
Expr *CoroHandle = CoroHandleRes.get();
- CallExpr *AwaitSuspend = cast_or_null(
- BuildSubExpr(ACT::ACT_Suspend, "await_suspend", CoroHandle));
@@ -339,6 +339,9 @@ Bug Fixes in This Version
- Fixes an assertion failure on invalid code when trying to define member
functions in lambdas.
+- Clang now emits errors for coroutine `await_suspend` functions whose return
type is not
+ one of `void`, `bool`, or
@@ -358,6 +364,30 @@ static Expr *maybeTailCall(Sema , QualType RetType, Expr
*E,
return S.MaybeCreateExprWithCleanups(JustAddress);
}
+static bool isSpecializationOfCoroutineHandle(Sema , QualType Ty,
+ SourceLocation Loc) {
+
github-actions[bot] wrote:
:white_check_mark: With the latest revision this PR passed the C/C++ code
formatter.
https://github.com/llvm/llvm-project/pull/85684
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/yuxuanchen1997 updated
https://github.com/llvm/llvm-project/pull/85684
>From 4e10b2c4dfed3fb59ee03c716852f7fb45de081a Mon Sep 17 00:00:00 2001
From: Yuxuan Chen
Date: Mon, 18 Mar 2024 10:45:20 -0700
Subject: [PATCH] Check if Coroutine await_suspend type returns the right
yuxuanchen1997 wrote:
@ChuanqiXu9
I have updated the patch to check for `std::coroutine_handle` and does not
rely on `SemaExprCXX` changes. Please let me know what you think.
https://github.com/llvm/llvm-project/pull/85684
___
cfe-commits mailing
https://github.com/yuxuanchen1997 edited
https://github.com/llvm/llvm-project/pull/85684
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
github-actions[bot] wrote:
:white_check_mark: With the latest revision this PR passed the Python code
formatter.
https://github.com/llvm/llvm-project/pull/85684
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/yuxuanchen1997 edited
https://github.com/llvm/llvm-project/pull/85684
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/yuxuanchen1997 updated
https://github.com/llvm/llvm-project/pull/85684
>From 6887adae7500c4791a8620fa5b558e195e2c64cc Mon Sep 17 00:00:00 2001
From: Yuxuan Chen
Date: Mon, 18 Mar 2024 10:45:20 -0700
Subject: [PATCH] Check if Coroutine await_suspend type returns the right
ChuanqiXu9 wrote:
> > I am confused. If we don't need to check whether a type can be converted to
> > std::coroutine_handle, why do we still need EvaluateBinaryTypeTraits or
> > similar things.
>
> I thought your previous comment was to show concern about exposing
>
ChuanqiXu9 wrote:
> In SemaExprCXX.cpp there's EvaluateBinaryTypeTraits that I needed to expose
> as suggested by the comment in SemaCoroutine. Is there an alternative way to
> do type coercion/equivalence checks?
I am confused. If we don't need to check whether a type can be converted to
yuxuanchen1997 wrote:
> I am confused. If we don't need to check whether a type can be converted to
> std::coroutine_handle, why do we still need EvaluateBinaryTypeTraits or
> similar things.
I thought your previous comment was to show concern about exposing
`EvaluateBinaryTypeTraits`
yuxuanchen1997 wrote:
> > I am also ok with changing the patch to reject programs whose await_suspend
> > doesn't strictly return std::coroutine_handle if upstream prefers.
>
> It should be good to do that since it makes the behavior more conforming. And
> maybe it is better to do this a
https://github.com/yuxuanchen1997 updated
https://github.com/llvm/llvm-project/pull/85684
>From 08de54f02038795924a6e5fdbcf51a496fcedf56 Mon Sep 17 00:00:00 2001
From: Yuxuan Chen
Date: Mon, 18 Mar 2024 10:45:20 -0700
Subject: [PATCH] Check if Coroutine await_suspend type returns the right
ChuanqiXu9 wrote:
> I am also ok with changing the patch to reject programs whose await_suspend
> doesn't strictly return std::coroutine_handle if upstream prefers.
It should be good to do that since it makes the behavior more conforming. And
maybe it is better to do this a seperate patch.
https://github.com/yuxuanchen1997 edited
https://github.com/llvm/llvm-project/pull/85684
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvmbot wrote:
@llvm/pr-subscribers-coroutines
Author: Yuxuan Chen (yuxuanchen1997)
Changes
This patch aims to fix https://github.com/llvm/llvm-project/issues/77111
The original issue is crash-on-invalid. However, Clang currently accepts
programs where `await_suspend` returns a type
https://github.com/yuxuanchen1997 created
https://github.com/llvm/llvm-project/pull/85684
This patch aims to fix https://github.com/llvm/llvm-project/issues/77111
The original issue is crash-on-invalid. However, Clang currently accepts
programs where `await_suspend` returns a type that's
31 matches
Mail list logo