[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block
Brian Gesiak via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 6 23:16:04 PST 2019
modocache added inline comments.
================
Comment at: lib/Sema/SemaCoroutine.cpp:675
+ // Second emphasis of [expr.await]p2: must be outside of an exception handler.
+ if (S.getCurScope()->getFlags() & Scope::CatchScope) {
+ S.Diag(Loc, diag::err_coroutine_within_handler) << Keyword;
----------------
EricWF wrote:
> We can still build a valid AST after encountering this error, no?
>
>
I believe so. Just to be clear: you'd like me to continue building the AST even after emitting this error diagnostic? My understanding is that most of this file bails soon after any error is encountered (correct me if that's wrong). I'm happy to change that, but I wonder if it'd be better to do that in a separate diff...?
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59076/new/
https://reviews.llvm.org/D59076
More information about the cfe-commits
mailing list