[coroutines] Fix rebuilding of implicit and dependent coroutine statements.
Summary: Certain implicitly generated coroutine statements, such as the calls to 'return_value()' or `return_void()` or `get_return_object_on_allocation_failure()`, cannot be built until the promise type is no longer dependent. This means they are not built until after the coroutine body statement has been transformed. This patch fixes an issue where these statements would never be built for coroutine templates. It also fixes a small issue where diagnostics about `get_return_object_on_allocation_failure()` were incorrectly suppressed. Reviewers: rsmith, majnemer, GorNishanov, aaron.ballman Reviewed By: GorNishanov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31487 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299380 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/AST/StmtCXX.h 4 additions, 0 deletionsinclude/clang/AST/StmtCXX.h
- lib/AST/StmtCXX.cpp 1 addition, 1 deletionlib/AST/StmtCXX.cpp
- lib/Sema/CoroutineStmtBuilder.h 70 additions, 0 deletionslib/Sema/CoroutineStmtBuilder.h
- lib/Sema/SemaCoroutine.cpp 61 additions, 67 deletionslib/Sema/SemaCoroutine.cpp
- lib/Sema/TreeTransform.h 51 additions, 44 deletionslib/Sema/TreeTransform.h
- test/SemaCXX/coroutines.cpp 45 additions, 3 deletionstest/SemaCXX/coroutines.cpp
Loading
Please register or sign in to comment