[PATCH] D59752: Un-revert "[coroutines][PR40978] Emit error for co_yield within catch block"

Brian Gesiak via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 24 14:23:00 PDT 2019


modocache created this revision.
modocache added reviewers: GorNishanov, tks2103, rsmith.
Herald added subscribers: jdoerfert, EricWF.
Herald added a project: clang.

https://reviews.llvm.org/D59076 added a new coroutine error that
prevented users from using 'co_await' or 'co_yield' within a exception
handler. However, it was reverted in https://reviews.llvm.org/rC356774
because it caused a regression in nested scopes in C++ catch statements,
as documented by https://bugs.llvm.org/show_bug.cgi?id=41171.

The issue was due to an incorrect use of a `clang::ParseScope`. To fix:

1. Add a regression test for catch statement parsing that mimics the bug report from https://bugs.llvm.org/show_bug.cgi?id=41171.
2. Re-apply the coroutines error patch from https://reviews.llvm.org/D59076, but this time with the correct ParseScope behavior.


Repository:
  rC Clang

https://reviews.llvm.org/D59752

Files:
  include/clang/Basic/DiagnosticSemaKinds.td
  include/clang/Sema/Scope.h
  lib/Parse/ParseStmt.cpp
  lib/Sema/Scope.cpp
  lib/Sema/SemaCoroutine.cpp
  test/SemaCXX/coroutines.cpp
  test/SemaCXX/exceptions.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59752.192045.patch
Type: text/x-patch
Size: 10742 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190324/bada0fc4/attachment-0001.bin>


More information about the cfe-commits mailing list