GorNishanov added a comment.

@rsmith, I am wondering what were your thoughts on where to generate try { body 
} catch (...) { p.set_exception(std::exception()); }

Would it be in SemaCoroutine.cpp? Essentially, add something like this:

    bool makeBody() {
      if (!OnException)
        return true;
      StmtResult CatchBlock = S.ActOnCXXCatchBlock(Loc, nullptr, OnException);
      if (CatchBlock.isInvalid())
        return false;
      StmtResult TryBlock = S.ActOnCXXTryBlock(Loc, Body, {CatchBlock.get()});
      if (TryBlock.isInvalid())
        return false;
      Body = TryBlock.get();
      return true;


cfe-commits mailing list

Reply via email to