]> granicus.if.org Git - clang/commit
[coroutines] Diagnose invalid result types for `await_resume` and `await_suspend...
authorEric Fiselier <eric@efcs.ca>
Sun, 28 May 2017 18:21:12 +0000 (18:21 +0000)
committerEric Fiselier <eric@efcs.ca>
Sun, 28 May 2017 18:21:12 +0000 (18:21 +0000)
commit1995be1cfda3ccb67b987f449b6c25c728cccc9f
tree3d67a1374bc720d2d93dd8808957426867064c11
parent689832e718b999abb02b7195a21b61ab480bf720
[coroutines] Diagnose invalid result  types for `await_resume` and `await_suspend` and add missing conversions.

Summary:
The expression `await_ready` is required to be contextually convertible to bool and `await_suspend` must be a prvalue of either `void` or `bool`.
This patch adds diagnostics for when those requirements are violated.

It also correctly performs the contextual conversion to bool on the result of `await_ready`

Reviewers: GorNishanov, rsmith

Reviewed By: GorNishanov

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D33625

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304094 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaCoroutine.cpp
test/SemaCXX/coroutines.cpp