================
@@ -129,7 +130,14 @@ static SmallString<32> buildSuspendPrefixStr(CGCoroData 
&Coro, AwaitKind Kind) {
   return Prefix;
 }
 
-static bool memberCallExpressionCanThrow(const Expr *E) {
+static bool ResumeExprCanThrow(const CoroutineSuspendExpr &S) {
+  const Expr *E = S.getResumeExpr();
+
+  // If the return type of await_resume is not void, get the CXXMemberCallExpr
+  // from its subexpr.
+  if (const auto *BindTempExpr = dyn_cast<CXXBindTemporaryExpr>(E)) {
+    E = BindTempExpr->getSubExpr();
+  }
----------------
yuxuanchen1997 wrote:

I guess you are correct that this is easy to miss some cases. In my case I 
missed the fact that the destructor of the `BindTempExpr->getTemporary()` can 
throw if marked `noexcept(false)`. I updated the PR to cover this case and 
including corresponding tests. 

Next up I will try to see how many cases I'll need to cover in a recursive 
check on `children()` like the one in `Sema::checkFinalSuspendNoThrow`.

https://github.com/llvm/llvm-project/pull/73160
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to