[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block

2019-03-22 Thread Brian Gesiak via Phabricator via cfe-commits
modocache added a comment. Reverted in rC356296 . I'll rework this change along with a test confirming https://bugs.llvm.org/show_bug.cgi?id=41171 doesn't occur. Apologies! Repository: rC Clang CHANGES SINCE LAST ACTION

[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block

2019-03-22 Thread Brian Gesiak via Phabricator via cfe-commits
modocache added a comment. Sorry for the late response, I'm looking now. Should I revert this for now? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59076/new/ https://reviews.llvm.org/D59076 ___ cfe-commits mailing

[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block

2019-03-22 Thread Brian Gesiak via Phabricator via cfe-commits
modocache added a comment. I'm pushing a revert. Sorry for the trouble! Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59076/new/ https://reviews.llvm.org/D59076 ___ cfe-commits mailing list

[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block

2019-03-22 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In D59076#1438479 , @riccibruno wrote: > This is causing https://bugs.llvm.org/show_bug.cgi?id=41171. @modocache Could you take a look please ? Nested scopes in a catch statement are completely broken because of this patch.

[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block

2019-03-21 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. This is causing https://bugs.llvm.org/show_bug.cgi?id=41171. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59076/new/ https://reviews.llvm.org/D59076 ___ cfe-commits mailing list

[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block

2019-03-15 Thread Brian Gesiak via Phabricator via cfe-commits
modocache added a comment. Great, thanks for the reviews, everyone! Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59076/new/ https://reviews.llvm.org/D59076 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block

2019-03-15 Thread Brian Gesiak via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC356296: [coroutines][PR40978] Emit error for co_yield within catch block (authored by modocache, committed by ). Changed prior to commit: https://reviews.llvm.org/D59076?vs=190740=190890#toc

[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block

2019-03-15 Thread Gor Nishanov via Phabricator via cfe-commits
GorNishanov accepted this revision. GorNishanov added a comment. This revision is now accepted and ready to land. LGTM Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59076/new/ https://reviews.llvm.org/D59076 ___

[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block

2019-03-14 Thread Brian Gesiak via Phabricator via cfe-commits
modocache updated this revision to Diff 190740. modocache added a comment. OK, I've responded to all your review comments -- thank you! Please give this another look when you get a chance. I would like to emit note diagnostics pointing to the catch blocks, but I've left that as a FIXME for now.

[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block

2019-03-14 Thread Brian Gesiak via Phabricator via cfe-commits
modocache updated this revision to Diff 190727. modocache added a comment. Remove unused function parameter. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59076/new/ https://reviews.llvm.org/D59076 Files: include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block

2019-03-14 Thread Brian Gesiak via Phabricator via cfe-commits
modocache updated this revision to Diff 190718. modocache added a comment. Thank you for the reviews! This revision fixes the nested try/catch behavior. I still need to modify this such that semantic analysis continues for the rest of the function body. Repository: rC Clang CHANGES SINCE

[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block

2019-03-07 Thread Gor Nishanov via Phabricator via cfe-commits
GorNishanov requested changes to this revision. GorNishanov added inline comments. This revision now requires changes to proceed. Comment at: lib/Sema/SemaCoroutine.cpp:675 + // Second emphasis of [expr.await]p2: must be outside of an exception handler. + if

[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block

2019-03-07 Thread Lewis Baker via Phabricator via cfe-commits
lewissbaker 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) <<

[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block

2019-03-07 Thread Lewis Baker via Phabricator via cfe-commits
lewissbaker added inline comments. Comment at: test/SemaCXX/coroutines.cpp:299-311 // FIXME: The spec says this is ill-formed. void operator=(CtorDtor&) { co_yield 0; // expected-error {{'co_yield' cannot be used in a copy assignment operator}} } void

[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block

2019-03-07 Thread Gor Nishanov via Phabricator via cfe-commits
GorNishanov added inline comments. Comment at: test/SemaCXX/coroutines.cpp:299-311 // FIXME: The spec says this is ill-formed. void operator=(CtorDtor&) { co_yield 0; // expected-error {{'co_yield' cannot be used in a copy assignment operator}} } void

[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block

2019-03-07 Thread Brian Gesiak via Phabricator via cfe-commits
modocache marked an inline comment as done. 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,

[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block

2019-03-07 Thread Brian Gesiak via Phabricator via cfe-commits
modocache updated this revision to Diff 189763. modocache added a comment. Add test case for executing a lambda using co_yield within a catch block. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59076/new/ https://reviews.llvm.org/D59076 Files:

[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block

2019-03-07 Thread Brian Gesiak via Phabricator via cfe-commits
modocache added inline comments. Comment at: lib/Sema/SemaCoroutine.cpp:197-200 - if (S.isUnevaluatedContext()) { -S.Diag(Loc, diag::err_coroutine_unevaluated_context) << Keyword; -return false; - } lewissbaker wrote: > Does removing this check now

[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block

2019-03-07 Thread Lewis Baker via Phabricator via cfe-commits
lewissbaker added inline comments. Comment at: lib/Sema/SemaCoroutine.cpp:197-200 - if (S.isUnevaluatedContext()) { -S.Diag(Loc, diag::err_coroutine_unevaluated_context) << Keyword; -return false; - } Does removing this check now mean that we're not

[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block

2019-03-06 Thread Brian Gesiak via Phabricator via cfe-commits
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) <<

[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block

2019-03-06 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF 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;

[PATCH] D59076: [coroutines][PR40978] Emit error for co_yield within catch block

2019-03-06 Thread Brian Gesiak via Phabricator via cfe-commits
modocache created this revision. modocache added reviewers: GorNishanov, tks2103, rsmith. Herald added subscribers: jdoerfert, EricWF. Herald added a project: clang. As reported in https://bugs.llvm.org/show_bug.cgi?id=40978, it's an error to use the `co_yield` or `co_await` keywords outside of a