[coroutines] Fix rebuilding of implicit and dependent coroutine statements.
authorEric Fiselier <eric@efcs.ca>
Mon, 3 Apr 2017 19:21:00 +0000 (19:21 +0000)
committerEric Fiselier <eric@efcs.ca>
Mon, 3 Apr 2017 19:21:00 +0000 (19:21 +0000)
commitbee782bb9212180689062b28d578981516655498
tree9d73081b74a67048ea134a0b83a053aad7a6c16d
parentdee5565869e00ef1fa62ea25c2f04c7d54b9e9fd
[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

llvm-svn: 299380
clang/include/clang/AST/StmtCXX.h
clang/lib/AST/StmtCXX.cpp
clang/lib/Sema/CoroutineStmtBuilder.h [new file with mode: 0644]
clang/lib/Sema/SemaCoroutine.cpp
clang/lib/Sema/TreeTransform.h
clang/test/SemaCXX/coroutines.cpp