diff options
author | Brian Gesiak <modocache@gmail.com> | 2019-03-25 00:53:10 +0000 |
---|---|---|
committer | Brian Gesiak <modocache@gmail.com> | 2019-03-25 00:53:10 +0000 |
commit | b15c35aff878cd59328de80b95ba35ab0399b2c8 (patch) | |
tree | 41b25de8d9a2099228db3a32d6ada54859350d3b /clang/lib/Sema/Scope.cpp | |
parent | 87d4ab8b92e17db517499403eaa2e0b19992fae2 (diff) | |
download | bcm5719-llvm-b15c35aff878cd59328de80b95ba35ab0399b2c8.tar.gz bcm5719-llvm-b15c35aff878cd59328de80b95ba35ab0399b2c8.zip |
Un-revert "[coroutines][PR40978] Emit error for co_yield within catch block"
Summary:
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.
Reviewers: GorNishanov, tks2103, rsmith, riccibruno, jbulow
Reviewed By: riccibruno
Subscribers: EricWF, jdoerfert, lewissbaker, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59752
llvm-svn: 356865
Diffstat (limited to 'clang/lib/Sema/Scope.cpp')
-rw-r--r-- | clang/lib/Sema/Scope.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Sema/Scope.cpp b/clang/lib/Sema/Scope.cpp index 09940688efa..51b0b24e57b 100644 --- a/clang/lib/Sema/Scope.cpp +++ b/clang/lib/Sema/Scope.cpp @@ -166,7 +166,9 @@ void Scope::dumpImpl(raw_ostream &OS) const { {SEHExceptScope, "SEHExceptScope"}, {SEHFilterScope, "SEHFilterScope"}, {CompoundStmtScope, "CompoundStmtScope"}, - {ClassInheritanceScope, "ClassInheritanceScope"}}; + {ClassInheritanceScope, "ClassInheritanceScope"}, + {CatchScope, "CatchScope"}, + }; for (auto Info : FlagInfo) { if (Flags & Info.first) { |